> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1894.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Change image quality

The Quality feature reduces the quality of images delivered through the CDN. It works in combination with at least one other Image Stack operation — such as Compression (WebP or AVIF), Resize, or Crop — and cannot run independently. The origin retains the original image; only the version delivered to end users is affected.

The following example shows the same image at four different quality settings. The visual difference is subtle for detailed or non-contrasted images, and more noticeable for images with large solid areas against contrasting backgrounds.

<Tabs>
  <Tab title="High (95%)">
    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503003793.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=77e04a08908e98344250182643b4bc7c" alt="Example of high image quality" width="768" height="1089" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503003793.png" />
    </Frame>
  </Tab>

  <Tab title="Medium (80%)">
    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503010449.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=c4e8ad16b50ddfb98637851aa4cf1f32" alt="Example of medium image quality" width="768" height="1089" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503010449.png" />
    </Frame>
  </Tab>

  <Tab title="Low (65%)">
    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503150481.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=c6f69250b6f8f43d60331a3ece90b23e" alt="Example of low image quality" width="768" height="1089" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503150481.png" />
    </Frame>
  </Tab>

  <Tab title="Custom value (50%)">
    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503151121.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=16c0bbaab42114d45b90bb9883467d82" alt="Example of custom value image quality" width="768" height="1089" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503151121.png" />
    </Frame>
  </Tab>
</Tabs>

## Enable quality

Quality is included in the paid Image Stack option. To use it, enable Image Stack for the CDN resource following the [Enable Image stack](/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack) guide.

## Use quality

Quality can be configured in two ways: via the Gcore Customer Portal to apply a default level to all images matching the rule, or via query parameters to set quality per individual image URL.

### Use quality in the customer portal

<Steps>
  <Step title="Open the Image optimization rule">
    Navigate to the settings of the required CDN resource. Click the **Rules** tab, then open the **Image optimization** rule.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11774830851473.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=594ef24057dfc09177439df6d6194ed5" alt="CDN resource settings showing OPTIONS and RULES tabs with Create rule button and Image optimization template in the dropdown" width="1150" height="319" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11774830851473.png" />
    </Frame>
  </Step>

  <Step title="Select the quality level">
    In the **Image Stack** section, select one of the built-in presets: **High (95%)**, **Medium (80%)**, **Low (65%)**, or **Custom value**. The default is **High (95%)**.

    To prevent quality reduction for PNG images, enable **Enable lossless for PNG**. When enabled, the quality setting applies only to JPG images.

    <Note>The quality value cannot exceed 100%.</Note>

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503278097.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=578f798a2a529754eb157cce4fcc8497" alt="Image Stack section showing Image quality radio buttons with High selected and Enable lossless for PNG toggle" width="475" height="594" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503278097.png" />
    </Frame>
  </Step>

  <Step title="Save the rule">
    Click **Save changes** at the top right corner of the page.
  </Step>
</Steps>

### Use quality via query parameters

Query parameters set quality for individual images by modifying the URL in the website source.

1\. Open the website source code.

2\. Find the URLs of the images whose quality needs to change.

3\. Add the `quality` query parameter to each URL alongside at least one other Image Stack parameter:

```
image.jpg?quality=value&tool2=value2…
```

where:

* `value` is a number between 1 and 100
* `tool2=value2` represents query parameters for any other Image Stack function such as [Compression](/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/configure-image-compression-to-webp-and-avif), [Resize](/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/reduce-image-size), or [Crop](/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/crop-images)

For example, to reduce quality to 76%, convert to AVIF format, and crop a 200×200 px area from the center:

```
image.jpg?quality=76&fmt=avif&crop=200,200
```

The following example shows the same image processed with different `quality` and `fmt` parameter combinations:

<Tabs>
  <Tab title="Before">
    * Link: img.jpg
    * Size: 813 KB
    * Quality: 100%

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480618769.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=781bb3ece1b13c6c4aab639f37b4af05" alt="Original image before processing" width="312" height="551" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480618769.png" />
    </Frame>
  </Tab>

  <Tab title="After WebP compression">
    * Link: img.jpg?quality=95\&fmt=webp
    * Size: 97.4 KB
    * Quality: 95%

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480610193.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=25da317d76cc0a099b18990ea6645ea7" alt="Image after WebP compression at 95% quality" width="314" height="556" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480610193.png" />
    </Frame>
  </Tab>

  <Tab title="After AVIF compression 50%">
    * Link: img.jpg?quality=50\&fmt=avif
    * Size: 97.4 KB
    * Quality: 48% (actual measured quality; AVIF encoding maps the requested value non-linearly)

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480735249.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=db96c26cd3ca299a84d008eca6b203e7" alt="Image after AVIF compression at 50% quality" width="308" height="548" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480735249.png" />
    </Frame>
  </Tab>

  <Tab title="After AVIF compression 10%">
    * Link: img.jpg?quality=10\&fmt=avif\&crop=300,600
    * Size: 18.5 KB
    * Quality: 10%

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480735505.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=4ed050662c5e67e34e51f2b4f8b5f50d" alt="Image after AVIF compression at 10% quality" width="273" height="545" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030480735505.png" />
    </Frame>
  </Tab>
</Tabs>

4\. Save the changes in the website source code.

## Check HTTP headers

After processing, the image URL and file extension remain unchanged. Use the HTTP response headers to verify that quality conversion was applied.

The `X-Img-Operations` header lists all conversions performed. If the value includes `convert`, the image quality was changed.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503623825.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=595751d34e826431ee2387bea24418dc" alt="Browser DevTools Response Headers panel showing X-Img-Operations header with value convert highlighted" width="435" height="470" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503623825.png" />
</Frame>

If `X-Img-Operations` does not contain `convert` and the CDN returns the original-quality image, check the `Img-Skip-Reason` header. It explains why the operation was skipped — for example, `converted image bigger than origin` appears when the configured quality value is higher than the original image quality. In this case, combine Quality with another Image Stack feature.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503627153.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=6a4782e6b78f6b4f7daf9e1fe603edbb" alt="Browser DevTools Response Headers panel showing Img-Skip-Reason header" width="553" height="386" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/change-image-quality/11030503627153.png" />
</Frame>
