Fitting an image within specified dimensions
Fitting an image within specified dimensions

To change the image size to fit in given width and height while retaining original proportions, specify the width and height parameters (w and h in URLs) while setting the crop parameter to fit (c_fit in URLs).

When using the 'fit' crop mode, all original image parts are visible. Both width and height dimensions of the transformed image must not exceed the specified width & height. However, they may be smaller than the specified values in order to keep the original proportion.

Here's an original image: Original

Here's how to make the image fit within 70x90 boundaries: Fit 70x90

Note that the result image is actually 70x47 in order to keep the original proportions of 864x567 (~1.5).

Here's an example of fitting the original image to 300x100, which will generate a 150x100 image (retaining the 1.5 aspect ratio): 300x100 fit

The 'fit' crop mode can be applied on overlays as well: Overlay fit

Note that the fit crop mode enlarges the image when requesting larger width and height than the original image's dimensions. For example (original is 912x608): Larger dimensions