


Because no fit mode has been set, a request to resize a 300×200 image to 250×250 results in a 250×167 output image. To achieve these characteristics while also preventing an image from being sized beyond its original dimensions, see fit=fillmax. The resulting image exactly matches the requested dimensions. Excess space is filled with a solid color or blurred version of the image. Resizes the image to fit within the requested width and height dimensions while preserving the original aspect ratio and without discarding any original image data. The relevant parameters can be added to the URL to modify the fallback behavior. When a face is not detected in the image, the image will fall back to fill the image instead of cropping it to a face. For example, a combination of fit=facearea,fill can be used. The output is the correct requested size, depending on the output aspect ratio and face area availability.įit=facearea&faceindex=2&facepad=1.5&w=300&h=300: Crops and resizes the image to 300×300, making use of the faceindex and facepad parameters to select a face within the image and zoom in.įallback parameters can also be set in addition to fit=facearea. This is the entire image, with no face area cropping, resized to 300×200.įit=facearea&w=300&h=200: Crops and resizes the image to 300×200, with the faces centered as closely as possible.

Can be used in conjunction with faceindex to identify a specific face, as well as facepad to include additional padded area around the face to zoom out from the immediate area around the faces. To adjust the position of the content in a cropped image, please review the crop mode parameter.įinds the area containing all faces, or a specific face in an image, and scales it to specified width and height dimensions. This is the original image at 300×200 size with no parameters applied.įit=crop&w=300&h=100: Resizing the image to 300×100 with fit=crop will fit the image exactly to those dimensions.įit=crop&w=200&h=200: Setting an equal value for width and height along with fit=crop will always result in a square image. Both the w and h parameters will also need to be set. It's used in conjunction with the the crop parameter, which controls how the image is cropped. The resulting image will match the width and height constraints without distorting the image. Resizes the image to fill the width and height dimensions and crops any excess image data. clip is the default, so is not necessary.įit=clip&w=100&h=100: Attempting to resize this image to be 100×100 with a fit mode of clip will result in an image that is 100×67 because the aspect ratio of the original image is maintained. Unset: This is the original image at 300×200 with no parameters applied. The resulting image will match one of the constraining dimensions, while the other dimension is altered to maintain the same aspect ratio of the input image. Resizes the image to fit within the width and height boundaries without cropping or distorting the image. The pixel extension is called an affine clamp, hence the value name, "clamp".ĭefault. The resulting image will match the constraining dimensions. Resizes the image to fit within the width and height dimensions without cropping or distorting the image, and the remaining space is filled with extended pixels from the edge of the image. Valid values are clamp, clip, crop, facearea, fill, fillmax, max, min, and scale. The fit parameter controls how the output image is fit to its target dimensions after resizing, and how any background areas will be filled.
