---
title: "CropParams"
canonical_url: https://docs.zvid.io/docs/structure/properties/crop-params/
source: docs/structure/properties/crop-params.md
content_revision: 6338386a1dd87e4a
---

# CropParams

`cropParams` selects a rectangular region from the source asset before the element is composed.

Location: an `IMAGE`, `VIDEO`, or `GIF` visual's `cropParams` field. Coordinates
are **source pixels**, measured from the source's top-left corner; they are
not output-canvas coordinates. Cropping and the element's placement/size are
separate operations. Keep the rectangle inside the source dimensions.

```typescript
interface CropParams {
  x: number;
  y: number;
  width: number;
  height: number;
}
```

| Property | Required | Notes                         |
| -------- | -------- | ----------------------------- |
| `x`      | Yes      | Left edge of the crop region. |
| `y`      | Yes      | Top edge of the crop region.  |
| `width`  | Yes      | Crop region width.            |
| `height` | Yes      | Crop region height.           |

`x` and `y` are nonnegative; `width` and `height` are at least 1 pixel, subject
to your plan's input-resolution limits. Check actual source dimensions before
choosing the crop. See [Media assets](https://docs.zvid.io/docs/concepts/media-assets/).

## Example

This is a property fragment to merge into a visual element:

```json
{
  "cropParams": {
    "x": 100,
    "y": 50,
    "width": 800,
    "height": 600
  }
}
```

## Used By

- [Image Elements](https://docs.zvid.io/docs/structure/image-elements/)
- [Video Elements](https://docs.zvid.io/docs/structure/video-elements/)
- [GIF Elements](https://docs.zvid.io/docs/structure/gif-elements/)
