Overview
Sources
Libraries
Images API

Subsample subsample

Specify a chroma subsampling scheme to use when the image is encoded.

Chroma subsampling is the practice of encoding images by implementing less resolution for chroma information than for luma information, taking advantage of the human visual system's lower acuity for color differences than for luminance.

Applying chroma subsampling produces smaller file sizes without affecting image quality significantly.

This parameter only applies to the output formats jpeg and avif.

Values

  • 444: prevents chroma subsampling.
  • 420: forces chroma subsampling.

The default value for this parameter is 420, so a 420 chroma subsampling scheme is applied by default to all output formats supporting it.

Examples

Prevents chroma subsampling with a value of 444 using subsample=444:

GET
https://assets.imglab-cdn.net/flowers.jpeg?subsample=444
Tulips field image encoded with disabled chroma subsampling using subsample parameter with a value of 444.
x px

Forces chroma subsampling with a value of 420 using subsample=420:

GET
https://assets.imglab-cdn.net/flowers.jpeg?subsample=420
Tulips field image encoded with enabled chroma subsampling using subsample parameter with a value of 420.
x px