To resize multiple images to the same dimensions without stretching, preserve each image's aspect ratio and choose one of two output methods:
- Cover and crop: Fill the entire target canvas, then crop the overflow.
- Contain and pad: Fit the entire image inside the target canvas, then fill the unused space with a color or transparency.
Stretching is the third mathematical option, but it changes the proportions of the subject. It should normally be avoided for photographs, products, logos, and artwork.
Why Equal Dimensions Can Distort Images
Every image has an aspect ratio:
aspect ratio = width รท height
A 1600 ร 900 image has a 16:9 ratio. A 1200 ร 1200 target is square. The original cannot fill that square and remain completely visible without leaving empty space.
There are only three ways to resolve the mismatch:
- Crop part of the image.
- Add padding around the image.
- Distort the image.
The right batch-resize setting depends on which compromise fits the publishing context.
Cover, Contain, or Stretch?
| Mode | Fills target canvas | Keeps entire source | Preserves proportions | Best for |
|---|---|---|---|---|
| Cover / crop | Yes | No | Yes | Thumbnails, cards, social covers |
| Contain / fit | No, padding fills gaps | Yes | Yes | Product catalogs, logos, documents |
| Stretch | Yes | Yes | No | Rare data-processing cases |
Cover and Crop
The image is scaled until the canvas is completely covered. Anything outside the target boundary is cropped.
Use it when:
- Every card must be edge-to-edge
- The subject has safe space around it
- Small variations in crop are acceptable
- The layout depends on a consistent thumbnail ratio
Contain and Pad
The image is scaled until the whole source fits inside the canvas. The remaining area becomes a background color or transparent padding.
Use it when:
- Every product must remain fully visible
- Cropping a logo or document is unacceptable
- A consistent background is part of the catalog design
- Source images have many different aspect ratios
Stretch
The image width and height are changed independently. A person may look unnaturally wide, a circle may become an oval, and a product's proportions may be misrepresented.
Use stretching only when the source geometry has no visual meaning or when distortion is explicitly required.
A Reliable Batch-Resize Workflow
Step 1: Choose the Final Use Case
Do not start with an arbitrary dimension. Identify where the files will be used:
| Use case | Example target |
|---|---|
| Square product card | 1200 ร 1200 |
| Blog thumbnail | 1200 ร 675 |
| Portrait social post | 1080 ร 1350 |
| Avatar | 800 ร 800 |
| Email product tile | 600 ร 600 |
These are examples, not platform requirements. Check the actual layout and upload limits before processing a large folder.
Step 2: Inspect the Source Mix
Look for:
- Landscape and portrait images in the same folder
- Transparent PNG files
- Small sources that would require upscaling
- Subjects close to an edge
- Existing borders or backgrounds
- Images with text that cannot be cropped
A batch dominated by centered product photos is well suited to contain mode. A set of editorial photographs may work better with cover mode plus manual review.
Step 3: Pick the Target Aspect Ratio
Dimensions determine both resolution and aspect ratio:
1200 ร 1200 = 1:1
1200 ร 675 = 16:9
1200 ร 800 = 3:2
1080 ร 1350 = 4:5
Choose the ratio required by the component first. Then choose enough pixels for the largest intended display without exporting unnecessarily huge files.
Step 4: Choose Crop or Padding
Use this decision:
Can any edge of the source be removed safely?
โโโ Yes โ use cover/crop
โโโ No โ use contain/padding
For a transparent output, select a format that supports transparency, such as PNG or WebP. JPEG fills transparent areas with a solid background, so choose that background deliberately before export.
Step 5: Set the Background and Alignment
Contain mode needs a canvas background. Common choices include:
- White for marketplace product photos
- A brand-neutral light gray for catalogs
- Transparent for assets reused on different backgrounds
- A sampled brand color for campaign graphics
Center alignment works for many batches, but it is not always correct. Shoes may need bottom alignment, portraits may need a higher focal point, and logos may require even optical spacing.
Step 6: Process and Review the Batch
Use a batch tool to apply identical settings to every file. The vekbox Image Tools guide covers canvas resizing, proportional scaling, cropping, compression, and batch export in the browser.
A typical workflow is:
- Open vekbox Image Tools.
- Add the source images or folder.
- Enter the target width and height.
- Select cover or contain behavior.
- Choose a background color or transparency.
- Select the output format.
- Preview representative landscape, portrait, and square sources.
- Export the batch and inspect the outliers.
Batch processing makes the rule consistent, but it does not remove the need for a visual check. Review files where faces, text, or products sit close to the edges.
Worked Example: Product Photos
Assume a storefront requires square 1200 ร 1200 images. The source folder includes:
shoe-side.jpg 1800 ร 1200
backpack-front.jpg 1200 ร 1600
watch-closeup.png 1400 ร 1400
Using contain:
- The shoe receives padding above and below.
- The backpack receives padding on the left and right.
- The watch nearly fills the square.
- Every product remains visible and keeps its proportions.
Using cover:
- The shoe is cropped at the left and right.
- The backpack is cropped at the top and bottom.
- The watch changes very little.
- Every tile is edge-to-edge, but some product detail may be removed.
For a catalog where the entire item must be visible, contain is safer. For an editorial grid that values visual impact, cover may be preferable.
Worked Example: Blog Thumbnails
A blog card uses a 16:9 thumbnail. Sources include screenshots, portraits, and wide diagrams.
A good workflow is:
- Use cover for photographs with enough safe space.
- Use contain for screenshots and diagrams with important edge content.
- Apply a consistent background to padded assets.
- Manually crop the most important hero images.
- Export a small set of responsive widths.
One batch setting may not be suitable for every content type. Splitting the folder into photo and screenshot batches usually produces better results than forcing both through the same rule.
Batch Resize vs CSS object-fit
CSS can make different source files look consistent in a web layout:
.product-image {
width: 100%;
aspect-ratio: 1;
object-fit: contain;
background: #f8fafc;
}
Or crop them visually:
.article-thumbnail {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
}
This changes how the browser displays the image. It does not change the downloaded file's pixel dimensions or file size.
Use CSS when:
- The same source must appear at different ratios in different components
- The content is managed dynamically
- The server already creates responsive variants
Preprocess the actual files when:
- A marketplace requires exact upload dimensions
- Users download or reuse the exported assets
- Oversized originals waste storage and bandwidth
- Every item needs a permanent background or crop
Many production sites use both: optimized source variants for performance and CSS object-fit for layout consistency.
Avoid Upscaling Low-Resolution Sources
If a 400 ร 400 image is exported as 1600 ร 1600, the file gains pixels but not real detail. It may look soft and can become larger without becoming better.
Options include:
- Choose a smaller target for the whole collection
- Keep the small source centered with padding
- Request a higher-resolution original
- Separate low-resolution assets for manual treatment
AI upscaling can invent plausible detail, but it can also alter text, logos, textures, and product features. Review the result closely before using it for commercial or factual imagery.
Preserve Transparency Correctly
Transparent sources require an output format that supports an alpha channel.
Use:
- PNG for lossless transparent graphics
- WebP for transparent images when the workflow supports it
If the final format is JPEG, select a background color first. Otherwise the transparent area may become black, white, or another tool-dependent default.
Check semi-transparent edges after conversion. Light halos can appear when an asset prepared for a white background is placed on a dark page.
File Naming and Folder Structure
Batch tools can produce hundreds of files quickly. Use a predictable naming scheme:
Original: backpack-front.jpg
Output: backpack-front-1200x1200.webp
Useful suffixes include:
- Dimensions:
-1200x1200 - Intended use:
-thumbnail,-product, or-avatar - Density:
-1xand-2x - Format or variant:
-web,-mobile, or-dark
Keep the original folder separate from generated output. Never overwrite the only high-quality source.
Compress After Resizing
Once every file has the correct dimensions, perform the final format conversion and compression. This avoids spending bytes on pixels that will be discarded.
For a complete optimization sequence, follow the guide to compressing images for the web without visible quality loss.
The final quality check should include:
- Correct width and height
- No stretched subjects
- Safe crops
- Consistent padding
- Correct transparency or background
- Acceptable file size
- Clear text and product details
Common Batch-Resize Mistakes
Forcing Width and Height Independently
This distorts the source. Lock the aspect ratio and use cover or contain.
Cropping Every File from the Center
Center cropping can cut off faces or objects near an edge. Review outliers or use focal-point controls when available.
Using White Padding Without Checking the Page
White borders are visible on dark or tinted layouts. Match the actual destination background or use transparency.
Mixing Screenshots and Photos
Screenshots often require contain mode and lossless output, while photos tolerate cropping and lossy compression. Process them as separate batches.
Overwriting Originals
Keep a master copy. Future layouts may require a different aspect ratio or a larger export.
Assuming Identical Dimensions Mean Identical Visual Scale
Two products can occupy different percentages of the canvas. Consistent dimensions do not automatically create consistent subject size. Product catalogs may need a second pass to normalize margins.
Frequently Asked Questions
How do I make all images 1000 ร 1000 without distortion?
Set a 1000 ร 1000 canvas and use either cover to crop the overflow or contain to add padding. Do not unlock the aspect ratio and force both dimensions.
Should product images use crop or padding?
Use padding when the entire product must remain visible. Use cropping when an edge-to-edge composition is more important and the crop cannot remove essential product information.
Can I keep a transparent background?
Yes. Use contain mode with a transparent canvas and export to PNG or WebP. JPEG does not support transparency.
Why do resized images look blurry?
The source may be smaller than the target, the export quality may be too low, or the browser may display the image larger than its file dimensions. Check all three.
Is object-fit: cover the same as cropping the file?
No. It crops only the displayed view inside the element. The browser still downloads the full source image.
Should every image on a website have the same dimensions?
Only images serving the same component or content role need consistent dimensions. Hero images, article screenshots, avatars, and product tiles often require different aspect ratios.
Final Checklist
Before exporting a batch:
- Confirm the destination's required aspect ratio.
- Choose cover for edge-to-edge crops or contain for full visibility.
- Keep the aspect ratio locked.
- Choose a deliberate background or transparency.
- Avoid upscaling weak sources.
- Preview portrait, landscape, and square examples.
- Keep originals separate.
- Compress only after the dimensions are final.
Consistent image dimensions are not just a file operation. The best result comes from choosing a visual rule that matches the component, applying it consistently, and reviewing the exceptions that automation cannot understand.