Quality

      Last updated May 18, 2020

    The quality parameter enables control over the compression level for lossy file-formatted images.

    API Pattern

    quality={value}

    Setting a secondary quality value when auto=webp is enabled

    quality={value},{value}

    Parameter

    Parameter Description
    quality Output image quality for lossy file formats.

    Parameter Values

    Value Description
    Integer A whole number between 1 and 100.

    Notes

    1. The quality parameter can be applied to the following output formats: png8, jpg, pjpg, webp, and webply
    2. A lower number represents a lower-quality output image with a smaller file size.
    3. A higher number represents a higher-quality output image with a larger file size.
    4. If no quality parameter is present for jpg, pjpg, or webp the output image will be returned at the default value set in the Image Optimizer user interface.
    5. If auto=webp is enabled by the URL or the service settings, the second value will be used as the quality value if the requestor sends the accept: image/webp request header.
    6. When only specifying quality, if the output image file size is larger than the input image, the original image will be delivered.

    Examples

    Description HTML Demo
    Output an image with quality set to 85 <img src="image.jpg?quality=85"/> Example
    Advanced Examples (Combining Additional Parameters)
    Description HTML Demo
    Setting a secondary quality value when auto=webp is enabled - Convert the image format to a progressive jpg with image quality set to 85. For browsers that support WebP set the image quality to 75. <img src="image.jpg?format=pjpg&auto=webp&quality=85,75"/> Example
    Back to Top