Hear from Slack, the ACLU, TED, & more at our customer summit in San Francisco Register
LOG IN SIGN UP
Documentation

Serving images

  Last updated June 14, 2017

By adding the transformation URL API query string parameters to your existing image URLs, images can be resized, cropped, rotated, compressed, and transcoded into different image formats for increased performance. Image transformations can be applied programmatically and on-demand, eliminating the need to batch process or maintain multiple copies of an image to support different sizes and characteristics of device viewing your image content.

Example transformation

Resize an image to 200px wide.

<img src="http://www.fastly.io/image.jpg?width=200"/>

Transformation order

Although the URL API parameters can be specified in any order, we normalize the transformation sequence within our system to the following order:

  1. trim
  2. crop
  3. orientation
  4. width height dpr fit resize-filter disable
  5. pad canvas bg-color
  6. format quality

Input and output formats

The source image can use any of the following image formats:

GIF, PNG, JPEG, WEBP

The optimized image can use any of the following image formats:

GIF, PNG, JPEG, WEBP

Input and output limits

Default quality level

When no quality value is specified, a default value of 85 is automatically applied. The quality parameter will be ignored by GIF and PNG output formats.

Meta data removal

To optimize your images for delivery, all metadata (for example, EXIF, XMP, or ICC) is removed to reduce file size. If an image contains an ICC profile, the data is applied directly to the image to ensure color output is correct.

WebP image support

WebP images can be delivered to supported browsers by adding the auto=webp parameter.

This article describes a product that may use third-party cloud infrastructure to process or store content or requests for content. For more information, see our cloud infrastructure security and compliance program.

Additional resources:


Back to Top