Crop operations are processed before
resizing. When combining crop with width
or height parameters, make sure to base your crop values on the original image
dimensions.
Parameters
Crop the output image to specific dimensions with optional positioning.Format 1 (Center crop): Specify
width,height to crop from the center or use with crop_gravity to control positioning.Format 2 (Positioned crop): Specify width,height,x,y where x and y are pixel offsets from the top-left corner.Unit: pixelsCrop the image to match a specific aspect ratio while maintaining the center point.Format:
width:height (e.g., 16:9, 1:1, 4:3)Default: autoSet the anchor point for center-based crops (Format 1 only).Values:
center, north, south, east, west, northeast, northwest, southeast, southwestDefault: centerCrop with a defined focal point that stays centered when possible.Format 1 (Absolute):
width,height,x_coordinate,y_coordinate where x,y are pixel coordinates of the focal point.Format 2 (Relative): width,height,x_relative,y_relative where x,y are decimal values from 0.0 to 1.0.How it works
When you apply crop parameters, Bunny Optimizer:- Identifies the crop dimensions and positioning you specified
- Extracts the selected region from the original image
- Applies any additional transformations (resize, filters, etc.)
- Delivers the cropped result from the edge cache
Usage
Basic cropping
Specify width and height to crop from the center of the image.Center crop
| Original | crop=300,300 |
|---|---|
![]() | ![]() |
Positioned cropping
Add x and y coordinates to specify exactly where the crop should start. The coordinates represent pixels from the top-left corner of the original image.Crop from specific position
| Original | crop=400,300,200,150 |
|---|---|
![]() | ![]() |
Aspect ratio cropping
Crop to a specific aspect ratio while keeping the center of the image in frame.Square crop
| Original | aspect_ratio=1:1 |
|---|---|
![]() | ![]() |
Widescreen crop
| Original | aspect_ratio=16:9 |
|---|---|
![]() | ![]() |
Portrait crop
| Original | aspect_ratio=2:3 |
|---|---|
![]() | ![]() |
Crop gravity
Control where the crop is positioned using gravity anchors. Works with Format 1 cropping (width and height only) to snap the crop to different positions.Northwest gravity
| Original | crop_gravity=northwest |
|---|---|
![]() | ![]() |
South gravity
| Original | crop_gravity=south |
|---|---|
![]() | ![]() |
East gravity
| Original | crop_gravity=east |
|---|---|
![]() | ![]() |
center (default), north, south, east, west, northeast, northwest, southeast, southwest
Focus cropping
Define a focal point that the crop centers around. Unlike standard positioned cropping, focus crop ensures your point of interest stays in the middle of the cropped area. When the focal point is too close to the image borders, Bunny Optimizer automatically adjusts the crop to maintain the specified dimensions while keeping the focal point as centered as possible.Absolute coordinates
| Original | focus_crop=400,300,500,400 |
|---|---|
![]() | ![]() |
Relative coordinates
| Original | focus_crop=400,300,0.5,0.5 |
|---|---|
![]() | ![]() |
Combining with other transformations
Cropping works seamlessly with other Bunny Optimizer parameters. Crop first, then apply resizing, quality adjustments, or filters to the cropped result:Crop and resize
Crop with aspect ratio and quality
Crop and convert format
Remember that crop operations are processed before resizing. If you apply
crop=800,600&width=400, the image is first cropped to 800×600, then resized
to 400×300 (maintaining the aspect ratio from the crop).









