Resize an Image to Exact Pixels
Contain, cover or stretch — and a preset library with the real numbers behind each one.
Three ways to fit one rectangle into another
| Mode | What it does | You get |
|---|---|---|
| Contain | Scales the image until it fits inside the box, touching one side | The whole image, no cropping, some empty space |
| Cover | Scales until the box is fully covered, overflowing on one axis | No empty space, but one edge is cropped off |
| Stretch | Forces the exact box on both axes | The exact size, with distortion if the ratios differ |
For a profile picture or a social post, cover is almost always what you want, because the platform will crop to its own shape anyway and you should decide the crop rather than let it. For a product photo on a listing page, contain is safer — cropping a product is worse than leaving space around it. Never use stretch on a photograph; it is only appropriate for synthetic textures where distortion is invisible.
DPI is metadata, not pixels
The single most common misconception about resizing. A 1200 × 1800 pixel image printed at 4 × 6 inches is 300 dpi; the same file printed at 8 × 12 inches is 150 dpi. Nothing about the file changed — only the physical size it was mapped onto. DPI is a number stored in the file header (and frequently ignored), while the pixels are the actual information. That is why 'make this 300 dpi' is not a resizing instruction: what you mean is 'make this 1200 × 1800 pixels so it can be printed at 4 × 6 inches'.
Upscaling cannot invent detail
Enlarging an image interpolates between existing pixels. It does not recover information that was never captured, and photographs usually look soft or posterised when pushed beyond about 150 percent of their original size. Screenshots, diagrams and vector-like graphics tolerate upscaling far better because their content is piecewise-flat — there are fewer competing edges for the interpolator to confuse.
The presets, and why the numbers are odd
Platform dimensions look arbitrary and usually are — they are the output of an internal pipeline the platform never documented. Some notable ones:
- Instagram square post — 1080 × 1080. Feed images are displayed at various widths but stored at 1080.
- Instagram portrait post — 1080 × 1350, a 4:5 ratio that occupies more vertical feed space than a square.
- Story / Reel — 1080 × 1920, i.e. 9:16. This is the safest canvas for any vertical video platform.
- YouTube thumbnail — 1280 × 720 (16:9). The minimum allowed width is 640.
- Open Graph / link preview — 1200 × 630, roughly 1.91:1. This is what appears when a link is shared almost anywhere.
- Print at 300 dpi — 4 × 6 in is 1200 × 1800 pixels; A4 is 2480 × 3508 pixels.
Resize is a creative crop decision, not just a maths operation. Before choosing cover, look at what falls outside the target rectangle — the top of a head, the edge of a product, the horizon. A crop that removes a chin reads as a mistake.
How to use it
- Drop your image, or paste one.
- Pick a preset, or type exact width and height.
- Choose contain, cover or stretch.
- Resize, then check the reported output dimensions before downloading.
Worth knowing
- DPI describes print mapping, not stored pixels — the same file can be any dpi.
- Upscaling interpolates and cannot recover detail that was never captured.
- Browser resampling quality is good for downscaling and approximate for large upscales.
- Open Graph previews are 1200 × 630 pixels, used by most link unfurlers.
Limitations
- No content-aware scaling or intelligent cropping — cover crops from the centre.
- Downscaling in a browser uses a simpler filter than a professional editor.
- EXIF orientation is applied by the browser but stripped from the output.
- Animated images lose their animation when drawn to a canvas.