Homepage

ImageResizeFit

Last edit: Oct 13, 2026

How an image is resized to the given width and height; the values follow the object-fit CSS property

enum ImageResizeFit {
  contain
  cover
  fill
  inside
  outside
}

Values

contain

Preserving aspect ratio, embed the image within both provided dimensions, filling the rest with the background color

cover

Preserving aspect ratio, crop the image to cover both provided dimensions

fill

Ignore the aspect ratio of the input and stretch to both provided dimensions

inside

Preserving aspect ratio, resize the image to be as large as possible while
ensuring its dimensions are less than or equal to both those specified

outside

Preserving aspect ratio, resize the image to be as small as possible while
ensuring its dimensions are greater than or equal to both those specified

Questions?

We are always happy to help with any questions you may have.

contact us