# Image Crop

Crop any part of an image by choosing a new width and height plus starting point for the crop.

Using an AI coding agent?

Install the [`sirv-dynamic-imaging`](https://www.skills.sh/sirv/image-optimization-skill/sirv-dynamic-imaging) skill, and your agent can build these image URLs for you. Ask in plain words, such as “Serve our product photos as 800px WebP.” [See all 8 skills](/help/rest-api/sirv-skills-for-ai-agents/)

Try it

![Original image](https://demo.sirv.com/harris.jpg?w=800)

Original

![Image with the options applied](https://demo.sirv.com/harris.jpg?cw=250&cx=50)

With options

Crop width

px%

Crop height

px%

Position X

px%center

Position Y

px%center

https://demo.sirv.com/harris.jpg**?cw=250&cx=50**

[](https://demo.sirv.com/harris.jpg?cw=250&cx=50)

Choose the new width and/or height - if you omit one, it will default to 100% of the image. Use `cw` to specify the new width in pixels or percent (%).

The example below was 400px and has been cropped to 300px width:

`https://demo.sirv.com/looks.jpg?cw=300`

![Image cropped in width](https://demo.sirv.com/looks.jpg?cw=300)

Use `ch` to specify the new height in pixels or percent (%). The example below has been cropped to 100px height:

`https://demo.sirv.com/looks.jpg?ch=100`

![Image cropped in height](https://demo.sirv.com/looks.jpg?ch=100)

Unless explicitly stated, cropping will start from the top left of the image. This can be adjusted with `cx` and `cy` options.

These 2 options will move the point of the crop in a specified number of pixels from the top left. For example, the cropping starts at 107 pixels across and 17 pixels down:

`https://demo.sirv.com/looks.jpg?ch=166&cw=166&cx=107&cy=17`

![Image cropped in width and height](https://demo.sirv.com/looks.jpg?ch=166&cw=166&cx=107&cy=17)

You can crop around the center of the image by setting **cx** and **cy** to ‘center’:

`https://demo.sirv.com/looks.jpg?ch=250&cw=190&cx=center&cy=center`

![Image cropped in width and height with center specified as starting point](https://demo.sirv.com/looks.jpg?ch=250&cw=190&cx=center&cy=center)

This image is cropped around the center of the image to 50% of its original height, 100% of its original width:

`https://demo.sirv.com/looks.jpg?ch=50%&cw=100%&cy=center&cx=center`

![Image cropped to 50% height from center](https://demo.sirv.com/looks.jpg?ch=50%25&cw=100%25&cy=center&cx=center)

Cropping can be combined with resizing to create an image of any size and shape:

`https://demo.sirv.com/looks.jpg?w=50%&h=50%&ch=120&cw=120&cx=40&cy=0`

![Resized and cropped image](https://demo.sirv.com/looks.jpg?w=50%25&h=50%25&ch=120&cw=120&cx=40&cy=0)

Change the crop values to show exactly the part of the image you need.
