> For the complete documentation index, see [llms.txt](https://clients.medianova.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clients.medianova.com/products/performance-cdn/image-optimization-and-webp/image-optimization.md).

# Image Optimization

Image Optimization transforms images delivered through Medianova CDN by applying processing modules directly through the CDN URL. Supported operations include resizing, padding, cropping, rotation, watermarking, and custom cropping.

Transformations are performed at the CDN edge without modifying the source image at the origin.

{% hint style="info" %}
Each transformed image URL creates a separate cache object. Purge each transformed URL individually to invalidate cached variants.
{% endhint %}

<figure><img src="/files/RdFGaUnzk8Z1Pf0HWzuy" alt="" width="563"><figcaption></figcaption></figure>

## Enable Image Optimization

Image Optimization is disabled by default.

{% stepper %}
{% step %}

### Open Optimization

Open your CDN Resource and select **Optimization**.
{% endstep %}

{% step %}

### Open Image Optimization

Select **Image Optimization**.
{% endstep %}

{% step %}

### Enable Image Optimization

<figure><img src="/files/6wvF4ydlPXxaAD2m682t" alt=""><figcaption></figcaption></figure>

Turn on **Image Optimization**.
{% endstep %}

{% step %}

### Confirm the change

<figure><img src="/files/NztGEPvQrG3uvcnqUVNo" alt=""><figcaption></figcaption></figure>

Click **Confirm**.
{% endstep %}
{% endstepper %}

Image Optimization becomes active after confirmation.

## Image Optimization limits

The following limits apply to source images and transformed image requests.

| Item               | Value                                                 |
| ------------------ | ----------------------------------------------------- |
| Supported formats  | JPG, PNG                                              |
| Maximum file size  | 100 MB                                                |
| Maximum resolution | 3000 × 3000 px                                        |
| Cache behavior     | Each transformed URL creates a separate cache object. |

The 3000 × 3000 px resolution limit applies to `mnresize`, `mncrop`, `mncropresize`, `mnpadding`, and `mncustomcrop`.

Requests that exceed the applicable file size or resolution limit return `415 Unsupported Media Type`.

### URL structure

Image Optimization modules use the following URL structure:

```
https://<ACCOUNT>.mncdn.com/<MODULE>/<PARAMETERS>/<PATH>/<IMAGE>.<EXT>
```

Replace:

* `<ACCOUNT>` with your Medianova CDN account name.
* `<MODULE>` with the Image Optimization module.
* `<PARAMETERS>` with the parameters required by the selected module.
* `<PATH>` with the image path, if applicable.
* `<IMAGE>` with the source image name.
* `<EXT>` with the supported source image extension.

For example, an origin image can be requested through the `mnresize` module as follows:

```
Origin:      https://www.example.com/path/image.jpg
Transformed: https://<ACCOUNT>.mncdn.com/mnresize/400/300/path/image.jpg
```

To verify a transformation, open the transformed CDN URL in a browser.

{% hint style="info" %}
Some image requests may fail due to format or size constraints.\
See [*Image Optimization Troubleshooting*](/products/performance-cdn/image-optimization-and-webp/image-optimization/image-optimization-troubleshooting.md) for details.
{% endhint %}

## **Image Optimization Modules Reference**

Each Image Optimization module operates independently and uses its own parameter structure.\
Select the module that matches the transformation you need.

<figure><img src="/files/DsNd6nWEzFrk3hLaXr9h" alt="" width="375"><figcaption></figcaption></figure>

### MNRESIZE

Resize an image while preserving its original aspect ratio.\
Either width or height may be set to `-` to auto-calculate the other dimension.

<figure><img src="/files/kHmyhxlj8910ewhbKGcg" alt="" width="375"><figcaption></figcaption></figure>

#### Syntax

```
https://{account}.mncdn.com/mnresize/{width}/{height}/{path}/{image}.{ext}
```

#### Parameters

<table><thead><tr><th width="364">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>width</code></td><td>Target width; use <code>-</code> for auto-calculated width</td></tr><tr><td><code>height</code></td><td>Target height; use <code>-</code> for auto-calculated height</td></tr><tr><td><code>path</code></td><td>(Optional) Folder path</td></tr><tr><td><code>ext</code></td><td><code>jpg</code>, <code>png</code></td></tr></tbody></table>

#### Examples

* `.../mnresize/400/225/image.jpg`
* `.../mnresize/-/300/image.jpg`
* `.../mnresize/400/-/image.jpg`

### MNPADDING

Add uniform padding around an image using a HEX color.

<figure><img src="/files/LIhSyStRQ4wDczqp6QIk" alt="" width="374"><figcaption></figcaption></figure>

#### Syntax

```
https://{account}.mncdn.com/mnpadding/{width}/{height}/{hex_color}/{path}/{image}.{ext}
```

#### Example

`.../mnpadding/400/125/C0C0C0/image.jpg`

### MNCROP

Crop the image to the target dimensions by centering the original image.

<figure><img src="/files/LfbpmLNgzXj0TEg6k3LZ" alt="" width="375"><figcaption></figcaption></figure>

#### Syntax

```
https://{account}.mncdn.com/mncrop/{width}/{height}/{path}/{image}.{ext}
```

### MNCROPRESIZE

Resize and crop the image in one step to produce exact output dimensions without distortion.

<figure><img src="/files/MNroSEoTIyPkOHa3upKt" alt="" width="375"><figcaption></figcaption></figure>

#### Syntax

```
https://{account}.mncdn.com/mncropresize/{width}/{height}/{path}/{image}.{ext}
```

### MNROTATE

Rotate an image by 90, 180, or 270 degrees.

<figure><img src="/files/GUHXvnoD0jQPapkM8qUW" alt="" width="375"><figcaption></figcaption></figure>

#### Syntax

```
https://{account}.mncdn.com/mnrotate/{angle}/{path}/{image}.{ext}
```

{% hint style="info" %}
MNROTATE cannot be combined with other modules.\
Supported angles: `90`, `180`, `270`.
{% endhint %}

### MNWATERMARK

Apply a custom watermark to all images served through the CDN.

#### Notes

* Watermarking must be enabled by Medianova Support.
* Newly served images receive the watermark automatically.
* Purge existing cache entries to apply the watermark to previously cached images.
* Transparent PNG watermarks are supported.

{% hint style="info" %}
Watermarked images cannot be rotated or cropped using other modules.
{% endhint %}

### MNCUSTOMCROP

Crop a specific region using pixel coordinates.\
Coordinates (`x`, `y`) represent the top-left point of the crop area.

<figure><img src="/files/pkLu0VTxzIg1Kn8bKJNX" alt="" width="375"><figcaption></figcaption></figure>

#### Syntax

```
https://{account}.mncdn.com/mncustomcrop/{width}/{height}/{x}/{y}/{path}/{image}.{ext}
```

#### Example

`.../mncustomcrop/800/1200/430/200/image.jpg`

{% hint style="info" %}
For automatic WebP conversion, see [WebP Optimization](/products/performance-cdn/image-optimization-and-webp/webp.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://clients.medianova.com/products/performance-cdn/image-optimization-and-webp/image-optimization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
