Fastly Image Optimizer API

      Last updated September 22, 2020

    The Fastly Image Optimizer is a real-time image manipulation and optimization service that drastically speeds up image delivery by serving pixel perfect, bandwidth efficient images to internet users, whatever device they are using.

    Image API reference

    Name Parameter Notes
    Width width Resize the width of the image.
    Height height Resize the height of the image.
    Device Pixel Ratio dpr Serve correctly sized images for devices that expose a device pixel ratio.
    Fit fit Set how the image will fit within the size bounds provided.
    Precrop precrop Remove pixels from an image before any other transformations occur.
    Crop crop Remove pixels from an image.
    Trim trim Remove pixels from the edge of an image.
    Pad pad Add pixels to the edge of an image.
    Canvas canvas Increase the size of the canvas around an image.
    Background color bg-color Set the background color of an image.
    Orientation orient Change the cardinal orientation of the image.
    Overlay overlay Overlay one image on top of another image.
    Overlay align overlay-align Set the position of the overlay image.
    Overlay repeat overlay-repeat Set how the overlay image will be repeated.
    Overlay width overlay-width Set the width of the overlay image.
    Overlay height overlay-height Set the height of the overlay image.
    Overlay pad overlay-pad Add padding to the edge of the overlay image.
    Brightness brightness Set the brightness of the output image.
    Contrast contrast Set the contrast of the output image.
    Saturation saturation Set the saturation of the output image.
    Sharpen sharpen Set the sharpness of the output image.
    Blur blur Set the blurriness of the output image.
    Format format Specify the output format to convert the image to.
    Frame frame Extract the first frame from an animated image sequence.
    Quality quality Optimize the image to the given compression level for lossy file formatted images.
    Optimize optimize Automatically apply optimal quality compression.
    Auto auto Enable optimization features automatically.
    Enable enable Enable functionality that is disabled by default.
    Disable disable Disable functionality that is enabled by default.
    Profile profile Specify the profile class of application when converting to video.
    Level level Specify the level constraints when converting to video.
    Resize filter resize-filter Specify the resize filter used when resizing images.
    Montage see docs Combine up to four images into a single displayed image.

    Additional resources:

    Back to Top

    Additional resources: