Image Compression and Performance

Optimizing images means making them load faster at a minimum visual quality loss. This mainly includes manipulating image format and quality. A right balance of those helps improving conversions and bounce rates; it positively affects your SEO ranking.

To understand which Image Transformations provide the most impact on optimizing your product pages, use PageDetox, our tool for analyzing and optimizing image performance.

Changing Image Format, format


Converts an image to one of the following formats:

  • jpeg — JPEG is a lossy image format (good compression, good for photos). JPEG doesn’t support an alpha channel, hence you can use the setfill operation that sets a background color. All browsers support JPEG.
  • png — PNG is a lossless format (good compression only for graphics) with alpha channel support. Supported by all browsers.
  • webp — WebP is a modern image format that supports alpha channel and lossy compression. The format is good for all kinds of images but supported by a limited number of browsers.
  • auto — the image format used for content delivery is set according to the presence of an alpha channel in your input and capabilities of a client.

Technically, the default behavior of auto is about always trying to deliver WebP images based on checking the Accept header. We do it if a client supports the image/webp MIME-type and you are running the default Uploadcare setup with our storage and the default CDN domain,

400x301 png 116Kb

400x301 jpeg 16Kb

400x301 webp 15Kb
Transparent, size is equal
to the opaque one.

Beside using -/format/auto/, there is another way to control which image format is delivered to a client. In HTML 5, you can force the browser to automatically choose a WebP image version over others. This is done by using <picture>. Simply, wrap your <img> element with <picture> and add <source> having its type set to type="image/webp". Compatible browsers will then automatically load the WebP image version; others will take either JPEG or PNG.

  <source srcset="//" type="image/webp"/>
  <img src="//"/>

Changing Image Quality, quality


Sets the level of image quality that affects file sizes and hence loading speeds and volumes of generated traffic. quality works with JPEG and WebP images.

When your input and output are both JPEGs and no destructive operations are applied, your output image quality is limited to the initial input quality: when you upload a highly compressed image, you can use the normal setting or go even higher, but it will not affect neither your compression settings nor file size.

  • normal — the default setting, suits most cases.
  • better — can be used to render relatively small and detailed previews. ≈125% file size compared to normal.
  • best — useful for hi-res images, when you want to get perfect quality without paying much attention to file sizes. ≈170% file size.
  • lighter — useful when applied to relatively large images to save traffic without significant losses in quality. ≈80% file size.
  • lightest — useful for retina resolutions, when you don’t have to worry about the quality of each pixel. ≈50% file size.

1x best 16Kb
Blurry on retina.

1.5x lighter 16Kb
Fits all screens.

2x lightest 16Kb
Perfect for retina.

Implementing Multi-Scan Images, progressive


Returns a progressive image. In progressive images, data are compressed in multiple passes of progressively higher detail. This is ideal for large images that will be displayed while downloading over a slow connection allowing a reasonable preview after receiving only a portion of the data. The operation does not affect non-JPEG images; does not force image formats to JPEG.

Baseline loading.

Progressive loading.

We’re always happy to help with code, integration, and other stuff. Search our site for more info or post your question in our Community Area.