> 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

Transform and optimize JPG, JPEG, and PNG images at the CDN edge using URL-based image processing modules.

Transform and optimize JPG, JPEG, and PNG images at the CDN edge using URL-based image processing modules.

Image Optimization applies transformations to images delivered through Medianova CDN by using processing parameters in the CDN URL. Supported operations include resizing, padding, cropping, rotation, watermarking, and custom cropping.

Image processing occurs at the CDN edge and does not require the source image to be modified or preprocessed at the origin.

{% hint style="info" %}
Each transformed image URL creates a separate cached object. Excessive transformation variations may increase cache fragmentation and storage usage. To remove previously cached variants, purge each transformed URL individually.
{% endhint %}

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-7890d886288a5c4c83c2f1131354ccd32b3c9f9a%2Freadme.jpg?alt=media" alt=""><figcaption></figcaption></figure>

## Enable Image Optimization

Image Optimization is configured per CDN Resource in the [Medianova Control Panel](https://cloud.medianova.com).

{% stepper %}
{% step %}

### Open Images

Open your CDN Resource and navigate to **Optimization → Images**.
{% endstep %}

{% step %}

### Enable Image Optimization

Enable the **Image Optimization** toggle.
{% endstep %}

{% step %}

### Save the Configuration

Select **Save** in the pending changes bar.

Review the pending configuration changes and confirm the update.
{% endstep %}
{% endstepper %}

## Image Optimization Limits

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

| Item               | Value                                                  |
| ------------------ | ------------------------------------------------------ |
| Supported formats  | JPG, JPEG, PNG                                         |
| Maximum file size  | 100 MB                                                 |
| Maximum resolution | 3000 × 3000 px                                         |
| Cache behavior     | Each transformed URL creates a separate cached 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:

```
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" %}
Image requests may fail when applicable format, file size, or resolution requirements are not met. See Image Optimization Troubleshooting 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-591af2bc5c48f4956daad2fe7e10ff2b34d68225%2Freadme-1.jpg?alt=media" 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-7250d27a9c52ad0caaec106f715d617c5e64717b%2Freadme-2.jpg?alt=media" 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-f22e4a5e96407fb1cd1d5709b79a981888e2322b%2Freadme-3.jpg?alt=media" 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-f0b60d8d026ff03a03b46905a7ad932d22f1f824%2Freadme-4.jpg?alt=media" 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-09a1132ce651f0e048de7a318f0c4e4d6c5763e7%2Freadme-5.jpg?alt=media" 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-dba652d1dcab29c0f500ea5c6e0cb4ead78cd94e%2Freadme-6.jpg?alt=media" 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="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-797b6e1224627e07577c6cb4c45f8c368fea1204%2Freadme-7.jpg?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
