> ## 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.

# Enable Image Stack

Image Stack is enabled for a CDN resource in two places:

* **Resource Settings** — applies Image Stack to all requests for that resource. Use this only when the origin serves static image assets exclusively. For mixed-content origins, enabling it resource-wide causes conflicts with the [Rewrite](/cdn/cdn-resource-options/image-optimization-paid/about-image-stack#conflict-with-the-rewrite-option) option.
* **Rules** — applies Image Stack to requests matching a specific URL pattern. This is the recommended approach for most resources.

The steps below describe how to enable Image Stack via a rule.

<Steps>
  <Step title="Open the CDN resource Rules tab">
    Open the settings of the required CDN resource and go to **Rules**. Click **Create rule** and select **Image optimization** from the template list.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack/enable-image-stack-image1.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=b9c124c8cb1a2b61a17658c42d37b448" alt="Create rule dropdown with Image optimization template selected" width="70%" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack/enable-image-stack-image1.png" />
    </Frame>

    The rule creation page opens with the pattern `/.*\.(jpg|jpeg|png)` pre-filled, which targets all JPG and PNG image requests.
  </Step>

  <Step title="Configure the Image Stack section">
    In the **Options** section, find the **Image Stack** card and enable the **Enable Image Stack** checkbox.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack/enable-image-stack-image2.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=ebc85d78d9c5d54dc22f829ba90c9fdd" alt="Rule creation page showing Image Stack option in the Options section" width="70%" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack/enable-image-stack-image2.png" />
    </Frame>

    After enabling, configure the parameters:

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack/enable-image-stack-image3.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=bd4d14fc02bbec11b9046f58a0eb2293" alt="Image Stack settings expanded showing Image quality, Compression, and Image Stack overview sections" width="70%" data-path="images/docs/cdn/cdn-resource-options/image-optimization-paid/enable-image-stack/enable-image-stack-image3.png" />
    </Frame>

    **Image quality** — default quality level for delivered images. Four values are available:

    * High: 95%
    * Medium: 80%
    * Low: 65%
    * Custom value: 0–100%

    **Enable lossless for PNG** — delivers PNG images without any quality loss. When enabled, the quality setting has no effect on PNG files.

    <Note>
      The quality setting cannot run independently. Enable at least one other option — Compression, Resize, or Crop — alongside Image quality. To set quality per individual image, add the `quality` query parameter to the image URL. For example: `https://image.example.com/image.jpg?fmt=avif&quality=50`
    </Note>

    **Compression** — converts JPG and PNG images to WebP or AVIF format. Enable **Enable WebP compression**, **Enable AVIF compression**, or both. When both formats are enabled and the browser supports both, images are delivered in AVIF.

    To apply compression per individual image, add the `fmt` query parameter to the image URL:

    ```
    https://image.example.com/image.jpg?fmt=webp
    https://image.example.com/image.jpg?fmt=avif
    ```

    For more details, see [image compression](/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/configure-image-compression-to-webp-and-avif).

    **Image Stack overview** — the resize and crop operations are configured per image via query parameters. Because each image has unique dimensions and crop coordinates, there are no resource-level defaults for these operations.

    For query parameter reference, see [Crop images](/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/crop-images) and [Reduce image size](/cdn/cdn-resource-options/image-optimization-paid/image-stack-tools/reduce-image-size).
  </Step>

  <Step title="Save the rule">
    Click **Create rule** to save changes. Image Stack becomes active within 5–10 minutes.

    <Note>
      When a rule with Image Stack is saved, the resource cache clears automatically and CDN servers begin requesting content from the origin. To prevent origin overload during this period, consider enabling [Origin Shielding](/cdn/cdn-resource-options/general/enable-and-configure-origin-shielding) first or scheduling the change during low-traffic hours.
    </Note>
  </Step>
</Steps>
