Fit: fit
- clip
- crop
- fill
- max
- facearea
fit=clip
This is the default option when an image dimension is specified using the h and w parameters. The image is resized to the supplied dimensions while other dimensions are altered to maintain the aspect ration of the input image.
fit=crop
The image is resized to fit the supplied image dimensions and crops any excess. Both h and w needs to be set.
fit=facearea
Finds the area around faces in an image and scales it to specified width and height dimensions.
fit=fill
The image is resized to fit within the requested h and w dimensions while preserving the original aspect ratio. Excess space is filled with a solid colour. The resulting image matches the supplied dimensions.
Height: h
h controls the height of the output image in pixels.
If only a single dimension is specified, the aspect ration will be maintained based on the aspect ratio of the input image.
Width: w
w controls the width of the output image in pixels.
If only a single dimension is specified, the aspect ration will be maintained based on the aspect ratio of the input image.
DPR: dpr
dpr controls the device-pixel ratio
The dpr parameter causes the w parameters to be treated as device independent pixels (also known as “CSS pixels”). A 400×300 image at dpr=2 will actually be a 800×600 pixel image.