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
| Field | Value |
|---|---|
| Canonical parameter | resizing_type |
| CLI flag | --resizing-type |
| Accepted values | cover, contain, fill, inside, outside |
| Legacy mappings | fit, 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.
| Cover | Contain | Fill |
|---|---|---|
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
| Value | Use when |
|---|---|
cover | The output must fill the requested dimensions, even if some content is cropped. |
contain | The full image should remain visible inside the requested box. |
fill | The output must match the exact dimensions, even if the image is distorted. |
inside | The image should fit within the requested bounds while preserving aspect ratio. |
outside | The image should cover at least the requested bounds while preserving aspect ratio. |
Best practices
- Use
coverfor fixed-card layouts where filling the frame matters. - Use
containwhen the entire image must remain visible. - Avoid
fillfor 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
fillwhen the design actually needscover. - Forgetting to set a background color for
containexamples where empty space matters.
Related pages
Last updated at: May 9, 2026