The size parameters allow you to control all aspects of resizing, cropping, and the fit-to-crop behaviour of your image.
width (w)
This parameter sets the width of the output image. w is an alias for this parameter.
If this parameter is omitted and the height parameter is set, the output width is set automatically such that the aspect ratio is preserved. If both height and width parameters are set, the output image dimensions are set as per the mode parameter.
If none of the height and width parameters are set, the original aspect ratio is preserved, and output dimensions depend on parameters like scale if provided.
The maximum value is 8192, and any output that exceeds this width will be scaled down to this value.
| width=250 | Original |
|---|---|
![]() | ![]() |
height (h)
This parameter sets the height of the output image. h is an alias for this parameter.
If this parameter is omitted, and the width parameter is set, the output height is set automatically such that aspect ratio is preserved. If both height and width parameters are set, the output image dimensions are set as per mode setting.
If none of the height and width parameters are set, the original aspect ratio is preserved, and output dimensions depend on parameters like scale if provided.
Maximum value for this is 8192, and any output which has more than this height will be scaled down to this value.
| height=250 | Original |
|---|---|
![]() | ![]() |
dpr
Specifies device pixel ratio. Valid values are between 1.0 and 3.0 and floating point numbers are valid parameters. This acts as a multiplier to both width and height. width=200&height=300&dpr=2 is equivalent to width=400&height=600.
This makes it easy to specify an image with the correct resolution when using srcset attribute of <img> tag.
enlarge
This boolean parameter specifies whether the output image should be enlarged if input image dimensions are smaller than required dimensions.
For example, if input image width is 800px wide and width=1000 is specified, the output image will still remain 800px. If enlarge=true is set, then only the output image will have 1000px width.
Default value of this parameter is false if mode is crop or stretch and true otherwise. You can't override the default false if mode is set to crop or stretch
mode
Specifies the resize behavior when width or height parameters are provided.
-
fit: Resize to fit within boundaries specified by
widthandheightparameters. If the ratio given differs from the original aspect ratio, only one dimension will be set as per the given value, and the other dimension will be smaller such that the original aspect ratio is maintained. -
crop: The entire defined area is filled, maintaining aspect ratio, but it might crop part of the image. The type of cropping is determined by the crop parameter.
-
stretch: Resize to fill the area defined by height and width. It might not preserve aspect ratio, and the image might be distorted.
-
min: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to the
widthandheightspecified. -
max: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to the
widthandheightspecified. -
fill: Preserving aspect ratio, resize the image to the maximum
widthorheightspecified, then embed on a background of the exact width and height as the original image. You can fill excess space with fill parameter. -
fillmax: Resize the image by preserving the aspect ratio and without stretching the original image. If the requested width or height exceeds the original, it will fill the space with a solid color or blurred version of the image, based on fill parameter value.
Default mode is fit.
| mode=fit | mode=crop | mode=stretch |
|---|---|---|
![]() | ![]() | ![]() |
fill
This parameter specifies how to fill the extra space created by mode=fill.
-
solidFills excess space with solid color specified by parameterfill-color. Iffill-coloris not specified, then the excess space will be filled withwhite. -
blurFills excess space with the blurred original image. -
backgroundFills excess space with the top-left corner color.
Default value of this parameter is solid.
| mode=fill&fill=background | mode=fill&fill=solid&fill-color=c0c0c0 | mode=fill&fill=blur |
|---|---|---|
![]() | ![]() | ![]() |
fill=blur options
With fill=blur, you can adjust the blur intensity. The value ranges from 1 to 100.
| mode=fill&fill=blur&fill-blur=10 | mode=fill&fill=blur&fill-blur=100 |
|---|---|
![]() | ![]() |
crop
Allows you to define crop position when using crop as mode parameter.
Valid values are entropy, smart, top, topleft, left, bottomleft, bottom, bottomright, right, topright , faces, center and focalpoint.
While other modes are self-explanatory, let us first describe some special crop modes.
- faces: detects all faces in an image and tries to keep them centered in the cropped image.
| mode=crop&crop=faces | original |
|---|---|
![]() | ![]() |
-
entropy: focuses on the region with the highest Shanon entropy.
-
smart: focus on the region with the highest luminance frequency and skin tones. Gumlet automatically finds a person or other objects in the image and keeps them in the center while cropping.
-
focalpoint: focus on the point given by you. It allows you to define the point of focus by
fp-xandfp-y. You can also define zoom usingfp-z.fp-xandfp-ymust be a float value between0.0to1.0and the default value will be0.5.fp-zcan be in the range of1to10and the default value is1.
Default mode if no parameter is provided is center.
| mode=crop | mode=crop&crop=smart | mode=crop&crop=focalpoint |
|---|---|---|
![]() | ![]() | ![]() |
mask
It masks the image as per the given input. Current supported mask shapes are ellipse and corners.
- ellipse: Mask image into ellipse shape. When the masked image is output as a PNG, the masked area will be transparent; otherwise, it will be the default background. To get the circle shape with mask, the output image must have the same width and height; otherwise, it will be oval.
- corners: Mask corners of the image are rounded. One can control it using the
rpixelsparameter by providing a pixel value that needs to be rounded.
| mask=ellipse | mask=corners | original |
|---|---|---|
![]() | ![]() |
extract (rect)
Extract a region from the image. rect is an alias for this parameter. This operation is always applied before resize operation. Please give the parameters according to the original image.
The value should be provided as a comma-separated list left,top,width,height.
leftis a zero-indexed offset from the left edgetopis a zero-indexed offset from the top edgewidthof the extracted imageheightof extracted image
| extract=0,0,300,300 | extract=300,300,200,200 | original |
|---|---|---|
![]() | ![]() | ![]() |
aspect ratio (ar)
Resize and crop the image to the given aspect ratio. This parameter will work only with mode=crop. ar is proportional representation between width and height.
E.g. ar=3:4&mode=crop will crop the image in an aspect ratio of 3:4. You can add one dimension (height or width) along with ar , and the other dimension will be automatically calculated based on the aspect ratio. height=400&ar=3:4&mode=crop Here, width 300 will be automatically calculated.
| height=400&ar=3:4&mode=crop | ar=1:1&mode=crop&crop=smart | original |
|---|---|---|
![]() | ![]() | ![]() |
pad
Pads/Extends the edges of the image with the color provided by the background parameter. The value should either be an integer, which adds padding of the same number of pixels to all edges, or it should be a comma-separated list of 4 integers as top,right,bottom,left.
E.g. pad=40,20,40,30 will add 40px padding on top, 20px on right, 40px on bottom and 30px on left. If you want to add the same padding to all sides, you can provide just one number like pad=40 and it will add 40px on all sides.
Please note this operation will add additional pixels and hence increase height and width of image. This operation is applied after resize. Please provide padding parameters accordingly.
| pad=30,30,30,30&bg=b03e5c | original |
|---|---|
![]() | ![]() |
trim
Trim "boring" pixels from all edges that contain values within a percentage similarity of the top-left pixel. The value of this parameter is number between 1 to 99 representing the percentage similarity.
This operation is applied after resize.
If you want to match a custom color and not use the top-left pixel, you can pass a hex color code by using trim-color parameter. For example trim=10&trim-color=fafafa.
| trim=50 | original | |
|---|---|---|
![]() | ![]() |
dpi
Dots per inch (DPI) specifies how we should convert SVG or PDF files, which are vector images, to raster images like JPEG. The higher the parameter, the bigger the default output sizes will be.
Default value is 72.
Image Size Parameters Summary
| Parameter | Action | Default Value | Range / Allowed Values |
|---|---|---|---|
width (w) | Sets the width of the output image. | Original aspect ratio width | Max 8192 |
height (h) | Sets the height of the output image. | Original aspect ratio height | Max 8192 |
dpr | Multiplies width and height by the specified device pixel ratio. | 1.0 | 1.0 to 3.0 |
enlarge | Controls whether images smaller than requested dimensions can be enlarged. | Mode dependent (false for crop/stretch, true otherwise) | true, false |
mode | Defines resizing behavior when width and/or height are supplied. | fit | fit, crop, stretch, min, max, fill, fillmax |
fill | Specifies how excess space is filled when mode=fill or mode=fillmax. | solid | solid, blur, background |
fill-blur | Sets the intensity of the blur when fill=blur is used. | Undefined | 1 to 100 |
crop | Defines the cropping position/anchor when mode=crop. | center | entropy, smart, top, topleft, left, bottomleft, bottom, bottomright, right, topright, faces, center, focalpoint |
mask | Applies a mask shape to the output image. | N/A | ellipse, corners |
extract (rect) | Extracts a specific rectangular region before resizing (left,top,width,height). | N/A | Comma-separated integers |
aspect ratio (ar) | Crops the image to a given ratio (used with mode=crop). | N/A | Ratio format (e.g., 16:9, 1:1, 3:4) |
pad | Adds padding to image edges using the background color (top,right,bottom,left or single value). | N/A | Pixel integer(s) |
trim | Trims background pixels matching top-left pixel (or custom trim-color) within similarity percentage. | N/A | 1 to 99 |
dpi | Sets dots per inch for rasterizing vector formats (SVG, PDF). | 72 | Positive integer |





























