# Crop

Crops the image to specified dimensions (**width** and **height**) while keeping proportions and delivers the resulting image via CDN.

<mark style="color:orange;">**func=crop**</mark>

{% hint style="info" %}
This is the default resizing mode when both **width** and **height** operations are used. You do not need to specify **func=crop** explicitly.
{% endhint %}

## Examples

| Preview                          | Syntax                                                                                                                                                                                                                           |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/DlqRvEFEarQTH3jn2grv) | [/docs/birds.jpg?<mark style="color:orange;">**func=crop**</mark>&<mark style="color:orange;">**w=600**</mark>&<mark style="color:orange;">**h=310**</mark>](https://fdocs.filerobot.com/docs/birds.jpg?func=crop\&w=600\&h=310) |
| ![](/files/xaPRRW9bBko8FY8RpUP0) | [/docs/birds.jpg?<mark style="color:orange;">**w=600**</mark>&<mark style="color:orange;">**h=410**</mark>](https://fdocs.filerobot.com/docs/birds.jpg?w=600\&h=410)                                                             |

## Gravity

Specifies which part of the image you wish to keep while cropping. If you omit the gravity option, central cropping is performed.

<mark style="color:orange;">**gravity=X**</mark>

### Available gravity values

| <mark style="color:orange;">**northwest**</mark>                                                                                                                                                 | <mark style="color:orange;">**north**</mark>                                                                                                               | <mark style="color:orange;">**northeast**</mark>                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:orange;">**west**</mark>                                                                                                                                                      | <mark style="color:orange;">**center**</mark> \| <mark style="color:orange;">**centre**</mark> (default)                                                   | <mark style="color:orange;">**east**</mark>                                                                                                                                            |
| <mark style="color:orange;">**southwest**</mark>                                                                                                                                                 | <mark style="color:orange;">**south**</mark>                                                                                                               | <mark style="color:orange;">**southeast**</mark>                                                                                                                                       |
| <mark style="color:orange;">**auto**</mark> - [more info](/dynamic-media-optimization-dmo/transformations/image-optimization/operations/crop/automatic-gravity-crop.md#automatic-gravity-legacy) | <mark style="color:orange;">**face**</mark> - [more info](/dynamic-media-optimization-dmo/transformations/image-optimization/operations/crop/face-crop.md) | <mark style="color:orange;">**smart**</mark> - [more info](/dynamic-media-optimization-dmo/transformations/image-optimization/operations/crop/automatic-gravity-crop.md#smart-gravity) |
| <mark style="color:orange;">**X,Y**</mark> - [more info](/dynamic-media-optimization-dmo/transformations/image-optimization/operations/crop/focal-point-crop.md)                                 |                                                                                                                                                            |                                                                                                                                                                                        |

### Examples

| Preview                          | Syntax                                                                                                                                                                                                                                               |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/Ka0fCIIC7wlQKtufLsjI) | [/docs/paris-salon2.jpg?<mark style="color:orange;">**w=500**</mark>&<mark style="color:orange;">**h=430**</mark>&<mark style="color:orange;">**gravity=west**</mark>](https://fdocs.filerobot.com/docs/paris-salon2.jpg?w=500\&h=430\&gravity=west) |
| ![](/files/Uo5cizWRy06axWsQMmRU) | [/docs/paris-salon2.jpg?<mark style="color:orange;">**w=500**</mark>&<mark style="color:orange;">**h=430**</mark>&<mark style="color:orange;">**gravity=east**</mark>](https://fdocs.filerobot.com/docs/paris-salon2.jpg?w=500\&h=430\&gravity=east) |
|                                  |                                                                                                                                                                                                                                                      |


---

# Agent Instructions: 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:

```
GET https://docs.scaleflex.com/dynamic-media-optimization-dmo/transformations/image-optimization/operations/crop.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
