Skip to main content

Resizing Type

Use resizing_type to control how Imgwire fits an image into a requested width and height.

Overview

When you request both Width and Height, the resizing type defines the fit behavior. This matters for fixed-size cards, avatars, product grids, media previews, and generated images that must fit a design slot.

Syntax

FieldValue
Canonical parameterresizing_type
CLI flag--resizing-type
Accepted valuescover, contain, fill, inside, outside
Legacy mappingsfit, fill-down, and auto map to inside; force maps to fill

Example

https://cdn.imgwire.dev/{organization_id}/{environment_id}/{image_id}?width=720&height=220&resizing_type=cover
image.url({
width: 720,
height: 220,
resizing_type: 'cover',
format: 'auto',
quality: 'auto',
});
imgwire images url img_123 --width 720 --height 220 --resizing-type cover

Live examples

Each example requests the same wide 720x220 output box. The extreme aspect ratio makes the fit behavior easier to see.

CoverContainFill
Demo image resized with cover behavior into a wide frameDemo image resized with contain behavior into a wide frameDemo image resized with fill behavior into a wide frame

In this example, cover fills the entire frame and crops content, contain keeps the full image visible with background fill, and fill stretches the image to the exact requested dimensions.

Choosing a resizing type

ValueUse when
coverThe output must fill the requested dimensions, even if some content is cropped.
containThe full image should remain visible inside the requested box.
fillThe output must match the exact dimensions, even if the image is distorted.
insideThe image should fit within the requested bounds while preserving aspect ratio.
outsideThe image should cover at least the requested bounds while preserving aspect ratio.

Best practices

  • Use cover for fixed-card layouts where filling the frame matters.
  • Use contain when the entire image must remain visible.
  • Avoid fill for photos unless distortion is acceptable.
  • Combine resizing type with Gravity when using crop-like behavior.

Common mistakes

  • Requesting width and height without specifying fit behavior.
  • Using fill when the design actually needs cover.
  • Forgetting to set a background color for contain examples where empty space matters.

Last updated at: May 9, 2026