Fit Mode for Resize • fit

Controls how the output image fits inside its target dimensions when resized. When both a width and height are provided, the possible methods by which the image should fit these are:

Values: inside, crop, contain, fill, outside

Default: inside

These options all preserve the aspect ratio, except for fill. And the crop option is the only one that will crop your image to preserve your aspect ratio.

  • inside: (default) Resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified. 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.

  • outside: Resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.

  • contain: Contain within both provided dimensions using "letterboxing" where necessary.

  • crop: Ensure the image covers both provided dimensions by cropping/clipping to fit. The resulting image will match the width and height constraints without distorting the image.

  • fill: Ignore the aspect ratio of the input and stretch to both provided dimensions.

inside

outside

contain

crop

fill

OMGIMG
©2020-2022
Still have some questions?
We do whatever it takes to make sure our customer service is the best in the business. Please email us and we'll help you out as soon as we can. We are in the GMT+2 time zone.
Contact us on: hello@omgimg.net
Please read our privacy policy, our terms of service here.