Crop

crop - c - c_<crop type>

Value
Type
Description

crop type

string

Default Value: cover

Value can be;

Eg. c_contain, c_crop, ... Required Parameters: width, height

Sets the crop type of image. When both width and height are provided, the original image aspect ratio might get broken. By changing crop type, you can adjust the aspect ratio.

Understand Main Crop Types

Crop Types Visualised

Original Image

Cover (default) - c_cover

Preserves the aspect ratio. Tries to cover the requested dimensions without disturbing images. Some parts of the image may get clipped off.

You can use Gravity to adjust image gravity. By default, it is center. (g_center)

Contain - c_contain

Preserves the aspect ratio. Fits the whole image in the requested dimensions. If there are empty spaces, they are filled with background color (bg).

Fill - c_fill

Ignores the aspect ratio. Stretches the image to fill empty spaces.

Crop - c_crop

Crops a region from image.

Should either use with x,y coordinates or AI Object Gravity.

Crop needs a region in order to work.

To satisfy this condition, we provide width, height, x, y.

https://demo.imagemash.io/w_200,h_200,x_100,y_300,c_crop/woman3.jpg

Thumb - c_thumb

Thumb is specifically designed to make thumbnails from images. It has special algorithms that differentiate it from Crop. Use c_thumb instead of c_crop if you are making thumbnails.

Needs AI Object gravity in order to work.

https://demo.imagemash.io/w_200,h_200,g_face,c_thumb/woman3.jpg

Last updated