> ## Documentation Index
> Fetch the complete documentation index at: https://autorender.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Crop

> Crop images to exact dimensions with crop modes, positional gravity, and face or object detection.

Crop images from the URL with the `c_` parameter. Crop modes decide how the image fits the target dimensions set by `w_` and `h_`, and positioning tokens decide which part of the image survives the crop.

> [!NOTE]
>
> Crop modes act on the target box defined by `w_` and `h_`. Face and object detection (`fo_`) find the focal point automatically, so you get consistent thumbnails without picking coordinates by hand.

## How does it work?

You add a crop mode to the transform segment alongside `w_` and `h_`. Each mode handles the aspect-ratio difference between the source and the target box differently:

* `c_crop` — cuts the image to the exact dimensions, centering the crop area.
* `c_fill` — scales the image to cover the whole box, cropping the overflow.
* `c_fit` — scales the image to fit inside the box, keeping the entire image.

> [tab] Original image
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/doc1/ar-juice.jpg
> ```
>
> ![Original image](https://assets.autorender.io/LOKVTtKVGb/doc1/ar-juice.jpg)

> [tab] Crop (c\_crop)
>
> Cuts to exact dimensions, centered by default.
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_crop/doc1/ar-juice.jpg
> ```
>
> ![Cropped image](https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_crop/doc1/ar-juice.jpg)

> [tab] Fill (c\_fill)
>
> Covers the whole target box, cropping the overflow.
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_fill/doc1/ar-juice.jpg
> ```
>
> ![Fill mode](https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_fill/doc1/ar-juice.jpg)

> [tab] Fit (c\_fit)
>
> Fits inside the box, keeping the entire image.
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_fit/doc1/ar-juice.jpg
> ```
>
> ![Fit mode](https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_fit/doc1/ar-juice.jpg)

The examples above crop to **360×360 px** (`w_360,h_360`).

## How to position the crop?

Add `p_` to choose which region of the image the crop keeps. The default is center.

| Position | Description |
| - | - |
| `p_c` | Center |
| `p_t` | Top center |
| `p_b` | Bottom center |
| `p_tl` | Top-left |
| `p_tr` | Top-right |
| `p_bl` | Bottom-left |
| `p_br` | Bottom-right |

> [tab] Position top (p\_t)
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_crop,p_t/doc1/ar-juice.jpg
> ```
>
> ![Top crop](https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_crop,p_t/doc1/ar-juice.jpg)

> [tab] Position bottom (p\_b)
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_crop,p_b/doc1/ar-juice.jpg
> ```
>
> ![Bottom crop](https://assets.autorender.io/LOKVTtKVGb/w_360,h_360,c_crop,p_b/doc1/ar-juice.jpg)

## How to crop by content?

Autorender can pick the focal point from the image itself instead of a fixed position. Use these when the subject moves around the frame across a catalog of images.

| Strategy | Description |
| - | - |
| `p_entropy` | Centers on the most information-rich area |
| `p_attention` | Centers on the area that draws the most attention |

> [!NOTE]
>
> `p_entropy` and `p_attention` analyze image content at request time, which makes them useful for generating focus-aware thumbnails automatically.

### Face detection (fo\_face)

`fo_face` detects faces and centers the crop on them — ideal for avatars, profile images, and portrait thumbnails.

> [tab] Original
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/doc1/face-crop.jpg
> ```
>
> ![Original face image](https://assets.autorender.io/LOKVTtKVGb/doc1/face-crop.jpg)

> [tab] Face detection (fo\_face)
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/fo_face/doc1/face-crop.jpg
> ```
>
> ![Face detection crop](https://assets.autorender.io/LOKVTtKVGb/fo_face/doc1/face-crop.jpg)

### Object detection (fo\_\<object>)

`fo_<object>` centers the crop on a named object, for example `fo_car`. Object detection recognizes the standard YOLO model classes such as `car`, `dog`, `person`, and `cat`.

> [tab] Original
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/doc1/blackporsche.jpg
> ```
>
> ![Original car image](https://assets.autorender.io/LOKVTtKVGb/doc1/blackporsche.jpg)

> [tab] Object detection (fo\_car)
>
> ```text theme={null}
> https://assets.autorender.io/LOKVTtKVGb/fo_car,w_600/doc1/blackporsche.jpg
> ```
>
> ![Car detection crop](https://assets.autorender.io/LOKVTtKVGb/fo_car,w_600/doc1/blackporsche.jpg)

## Next steps

> [card] [Resize and aspect ratio](https://autorender.io/docs/transformations/resize-and-aspect-ratio.md)
>
> Set the `w_`, `h_`, and `ar_` values the crop fits into.

> [card] [Zoom](https://autorender.io/docs/transformations/zoom.md)
>
> Magnify a region before cropping to tighten the focus.

> [card] [Border radius](https://autorender.io/docs/transformations/border-radius.md)
>
> Round a face crop into a circular avatar.

> [card] [Recipes](https://autorender.io/docs/transformations/recipes.md)
>
> Save crop combinations as reusable `t_` tokens.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.