Image Processing Guide · Updated November 15, 2026
Cover vs. Contain vs. Fill: Resize Images Without Distortion
When the target width and height have a different aspect ratio from the original, the resize mode determines whether to crop, pad, or stretch. The tool uses Sharp’s resize modes; the examples below explain the trade-offs so you can inspect the result before downloading.
1. Cover: Fill the Target and Crop the Excess
Cover scales uniformly until the target width and height are filled, then removes the overhanging edges. A rectangular original can become a square without stretching the face, but some content will be lost.
Use cover when you need exact dimensions without padding, then inspect what was removed. For document photos, keep the required head size and margins. Some digital passport routes request an uncropped original, so check the application instructions before cropping.
2. Contain: Keep the Whole Image with Padding
Contain scales uniformly until the whole original fits inside the target box. If the aspect ratios differ, background padding fills the remaining area. For example, a wide product image can fit on a square canvas without losing its ends.
This is useful for product layouts where the subject must stay complete. Check the chosen padding colour and the receiving platform’s rules. Do not add artificial borders to document photos when the authority requires an edge-to-edge portrait.
3. Inside and Outside: Proportional Scaling without Padding
- Inside keeps both output dimensions at or below the requested limits without adding padding. One dimension may be smaller than requested, so it does not guarantee an exact output rectangle.
- Outside keeps both dimensions at or above the requested limits without an automatic crop. One dimension may be larger than requested. Check the result before sending it to a portal with exact pixel limits.
4. Fill: Force Width and Height Independently
Fill ignores the original aspect ratio and stretches or compresses each axis as needed. Use it only when that distortion is intentional. For portraits and product photography, cover or contain usually makes the trade-off easier to control.
FAQ
What happens when I select an interactive crop?
The selected rectangle is extracted before resizing. The final result still depends on the target dimensions and resize mode. Check the downloaded image rather than assuming that selecting a crop validates an official photo.
Which output format should I choose?
PNG is useful for lossless graphics, JPEG for widely supported photographic files, and WebP for many modern websites. Quality settings and file-size savings depend on the image and encoder. For an official portal, use its required format and verify the actual file size.
Sources and further reading
- Sharp — Resizing Images (Sources checked: 2026-11-15)
- U.S. Department of State — Digital Image Requirements (Sources checked: 2026-11-15)
- HM Passport Office — Digital Passport Photos (Sources checked: 2026-11-15)