HandyVale › Guides

Bulk Image Resizer: What “Same Size” Costs on Six Different Shapes

Updated 2026-10-28 · handyvale.com

Short answer

Pick fill when your subject sits near the middle of the frame, fit when it does not, and longest edge when the layout can accept different heights. Never stretch. On six files resized to 1080 × 1080, fill threw away 25% of the pixels on a 4:3 frame, 33.33% on a 3:2 frame and 75% on a 1:4 strip. Fit padded exactly the same fractions and left them as background. Stretch kept every pixel and changed the aspect ratio by 25% to 300%.

And the batch that was supposed to shrink got bigger: the 800 × 600 file grew 28.14% when stretched up to 1080, and grew under all four modes. A fixed target size is also a decision to enlarge everything smaller than it.

Browser-side processing — your images are never uploaded · No login · No watermark · No file-size or use limit · JPG, PNG or WebP out

Four buttons, four different operations

Every batch tool in the results offers the same four choices under different names: stretch to the box, fit inside the box, fill the box and crop the overflow, or scale by the longest edge. They look like four settings of one thing. They are four different edits: two keep every pixel, one throws pixels away, and one changes the proportions.

Six files, one target of 1080 × 1080, four modes, same encoder (JPEG quality 85, optimise on). Bytes are the output file size; the percentage under each one is against the file that went in.

Source
bytes in
StretchFitFillLongest
edge
3,000 × 4,000
4,660,280
102,014
−97.81%
77,965
−98.33%
114,651
−97.54%
71,066
−98.48%
4,000 × 3,000
4,647,759
102,454
−97.80%
77,399
−98.33%
113,454
−97.56%
70,948
−98.47%
1,200 × 1,200
578,475
251,308
−56.56%
251,308
−56.56%
251,308
−56.56%
251,308
−56.56%
800 × 600
198,217
253,998
+28.14%
207,468
+4.67%
243,817
+23.01%
199,997
+0.90%
6,000 × 4,000
9,229,345
78,022
−99.15%
53,032
−99.43%
91,313
−99.01%
46,744
−99.49%
500 × 2,000
410,121
209,858
−48.83%
56,158
−86.31%
223,712
−45.45%
44,482
−89.15%

The square file is the control. All four modes produce 251,308 bytes because a 1:1 source in a 1:1 box has nothing to crop, pad or squash. Every difference in this table comes from the shape mismatch, not from the settings.

What each mode did to the picture

Same six files. This is the part the file size does not show: how much of the source survived, how much of the canvas is background, and how far the proportions moved.

SourceFit: canvas paddedFill: pixels discardedStretch: aspect changeLongest edge: output
3,000 × 4,00025.00%25.00%+33.33%810 × 1,080
4,000 × 3,00025.00%25.00%+25.00%1,080 × 810
1,200 × 1,2000.00%0.00%0.00%1,080 × 1,080
800 × 60025.00%25.00%+25.00%1,080 × 810
6,000 × 4,00033.33%33.33%+33.33%1,080 × 720
500 × 2,00075.00%75.00%+300.00%270 × 1,080

Fit and fill take the same bite. That is not a coincidence: both fit the source into the same box, one by leaving the leftover area empty, the other by cropping it away. The padded percentage and the discarded percentage are the same number by construction, and it is 1 − (box area ÷ covered area). What changes is whether the missing area becomes white, a blur, or nothing.

The strip is the case that decides the argument. A 500 × 2,000 banner squeezed into a square loses three quarters of its pixels under fill, sits in a square that is three quarters background under fit, and is stretched 4× wider than it should be under stretch. No setting rescues it. That file does not belong in a square batch.

Same 1080 × 1080 box, six sources, fit mode blue = your pixels, pale = background you did not ask for 3:4 → 25% pad 4:3 → 25% pad 1:1 → 0% pad 4:3 small → 25% 3:2 → 33.33% 1:4 strip → 75% Fill mode, same six same fractions, but the pale area is gone and so are your pixels 25% cropped 25% cropped 0% cropped 25% cropped 33.33% cropped 75% cropped

Both rows are the same arithmetic. Fit leaves the leftover as background, fill cuts it off. Neither invents pixels, which is why both are safe and both cost you something.

The batch that got bigger

A fixed target width is a one-way instruction: it applies to the 6,000-pixel file and to the 800-pixel file alike. The 800 × 600 file went to 1080 × 1080 and grew under all four modes — 198,217 bytes in, 253,998 out under stretch (+28.14%), 243,817 under fill (+23.01%), 207,468 under fit (+4.67%), 199,997 under longest edge (+0.90%).

Fit was the mildest and still grew, because padding adds flat area that compresses well but is not free. Stretch was the worst, because it manufactures 2.43 times the pixels — 480,000 in, 1,166,400 out — and then pays JPEG to encode them.

Those new pixels are not detail. Measured as mean absolute gradient over the greyscale channel, the same file scores 21.531 at its native 800 × 600, 14.768 after a 1.35× enlargement to 1080 × 810 (−31.41%), and 8.124 after 2.7× to 2160 × 1620 (−62.27%), which costs 585,422 bytes — 2.95 times the original file. You paid 2.95× the bytes for an image that is measurably softer everywhere.

So the first pass over a batch is a count, not a resize: how many files are already smaller than the target? Those are the ones a fixed target will enlarge, and most tools will do it without asking. If the tool has a “do not enlarge” switch, use it. If it does not, run those files separately at their native size, or accept that the batch will be bigger than the folder it came from.

Order: resize first, then encode

Both orders end at the same dimensions. They do not end at the same bytes, and they do not end at the same picture.

One 3,000 × 4,000 photo, resized to 1080 × 1,440 and saved at JPEG quality 82: 125,372 bytes, 38.035 dB against the uncompressed downscale. Encode the full-size file at quality 82 first, then resize the decoded result to 1080 × 1,440: 127,853 bytes, 37.821 dB. The second order is 2,481 bytes larger and 0.214 dB worse, because JPEG spends its budget on detail that the next step throws away, then the resampler averages the block edges it left behind.

The gap is small. The gap between either of them and “just compress it” is not: encoding the same photo at quality 82 without resizing gives 2,119,775 bytes, 16.91 times the resized file, for pixels nobody will see at display size.

Practical version: dimensions first, encoding second, and never both twice. A tool that resizes and then re-encodes an already-encoded file has done the second-order path whether it says so or not.

The 100 KB box, and what it charges

Several batch tools take a target file size in KB instead of dimensions, and the related searches for this term are full of people asking for exactly that. It works, but it spends whatever it has to spend to hit the number — and what it spends is quality.

Route to 100 KBOutputJPEG quality neededBytesPSNR vs uncompressed reference
Full size, no resize3,000 × 4,0001396,13628.18 dB
Resized to 1080 wide first1,080 × 1,44078102,26437.70 dB

Nine and a half decibels. The same target, the same encoder, the same picture — one route keeps quality 78, the other is down at 13, where JPEG blocking is visible at 100% on any screen. A target-size batch on a folder of full-resolution photos will quietly pick the second route, because it has no instruction to resize.

If the target number is the requirement, give it the smallest file that still meets the display size. If the display size is the requirement, give it pixels and leave quality alone.

Orientation, in a batch

Phone photos store pixels in one orientation and a tag that says how to turn them. A single image with the tag mishandled is obvious: you look at it and it is sideways. In a batch of forty it is not obvious at all, and there are three different wrong answers a tool can give.

Test file: 4,000 × 3,000 stored pixels, Orientation tag = 6 (display rotated 90° clockwise, so the correct result is portrait). Target: 1080 wide on the displayed image.

What the tool didFile on diskTag keptWhat a viewer showsBytes
Resized stored pixels, kept the tag1,080 × 8106810 × 1,080, upright but small82,184
Resized, then stripped the tag1,080 × 810nonesideways82,148
Rotated pixels first, then resized1,080 × 1,440none1,080 × 1,440, upright and correct171,897

The first row is the one that survives a review. Nothing looks broken — the image is upright, the colours are right, the subject is in frame — but the long edge is 1,080 instead of 1,440, which is 56.25% of the pixels you asked for. The width was pinned before the rotation, so the rotation ate a quarter of it. The third row is 2.09 times the bytes of the first, and it is the only correct one.

The second row is what happens when a tool strips metadata for privacy and does not rotate the pixels to match. Every photo from that batch is rotated 90° from what the camera showed, and the fix is not a resize — it is re-exporting from the originals.

Six files in, three files out

Batches come from folders, and folders reuse names. Two shooting days, both starting at IMG_0001.jpg, is the normal case, not the edge case. Drop both folders into a tool that zips the results flat and the ZIP gets six entries with three distinct names.

Measured on exactly that: 6 input files, 6 entries in the archive, IMG_0001.jpg twice, IMG_0002.jpg twice, IMG_0003.jpg twice. Extracting the archive leaves 3 files. The other 3 were overwritten during extraction, and the archive still weighs the same, so nothing about the file size tells you it happened.

Two fixes, both cheap. Prefix the output with something that identifies the folder (day1-IMG_0001.jpg), or run a counter across the whole batch (img-001.jpg to img-006.jpg) and let the original name live in a spreadsheet. Then count the extracted files against the input count before you delete anything. Six in, six out, or the batch failed quietly.

How long it takes, and how much memory it wants

Same six files, target 1080 on the longest edge, decoded, resampled with Lanczos and encoded at quality 85. Per-file time on this machine, in milliseconds: 455.7 (3,000 × 4,000), 735.7 (4,000 × 3,000), 84.4 (1,200 × 1,200), 50.4 (800 × 600), 707.9 (6,000 × 4,000), 48.7 (500 × 2,000). Total 2,082.8 ms for six files, median 455.7 ms.

Extrapolation, with the formula written out because it is an extrapolation and not a measurement: 500 files × 455.7 ms = 227,850 ms, about 3 minutes 48 seconds, if every file were median-sized. The honest range from the same measurements is 500 × 48.7 ms = 24.4 seconds for small files up to 500 × 735.7 ms = 6 minutes 8 seconds for large ones. A real folder is a mix, so it lands somewhere between, closer to the top if the files are phone photos.

Memory is arithmetic, not measurement: a decoded 6,000 × 4,000 image is 6,000 × 4,000 × 3 bytes = 72,000,000 bytes, 68.66 MiB in RGB, or 91.55 MiB with an alpha channel. Fifty of those decoded at once would be 3,433 MiB. No browser tab will do that, which is why batch tools process a queue rather than a folder, and why a tool that looks frozen on file 12 of 50 is usually working, not dead.

The six-step pass

  1. Count before you convert. How many files, and how many are already smaller than the target in both dimensions. Those are the ones a fixed size will enlarge.
  2. Set the target from the destination, not from a round number. A 600-pixel-wide slot at 2× density wants 1,200 pixels. 1080 is a video convention, not a web one.
  3. Choose the mode by where the subject sits. Centred subject, fill. Subject at an edge, fit. Mixed shapes going into a layout that can flex, longest edge.
  4. Fix orientation before dimensions. Rotate the pixels, drop the tag, then resize. Pinning a width first and rotating afterwards costs a quarter of the long edge.
  5. Resize, then encode once. Quality 82–85 on JPEG is the range where the file stops shrinking much and starts showing blocks. Do not encode an already-encoded intermediate.
  6. Name, then verify the count. Folder prefix or running index. Six in, six out.
Your call, not ours: whether your subject is centred. Fill and fit are the same arithmetic, so the only thing that decides between them is where the important part of each picture sits. A face in the middle of a portrait survives a square crop; a face at the top of it does not. Nobody can measure that from the file.
Your call, not ours: whether those small files belong in this batch at all. If the folder is 40 phone photos and 6 old web images, the 6 are the ones that will grow. Split them out, or accept a batch that is larger than its input — only you know which of those two is cheaper for you.
Your call, not ours: whether this is a one-off or a pipeline you will run every week. A one-off can be fixed by hand at the end. A weekly run needs the naming rule and the count check baked in now, because the week it silently drops three files is the week nobody notices until the listing goes live.
Need one image at an exact pixel size? Crop it to the numbers — in the browser, no upload

What was measured, and what was not

Related guides

Frequently asked questions

How do I get high-quality images for my website?

Start with the largest file you have, export once at the width the layout actually renders (times two for high-density screens), and do not let a byte target decide the quality for you. Measured on one 3,000 × 4,000 photo: resized to 1080 wide it hit 102,264 bytes at JPEG quality 78, scoring 37.70 dB against the uncompressed downscale. Forced into 100 KB at full size, the same photo needed quality 13 and scored 28.18 dB. The quality came from the resize, not from the format or the optimiser. A 6,000 × 4,000 file resized to 1,080 × 720 and encoded at quality 85 landed at 46,744 bytes, 99.49% below the 9,229,345 it started at.

Can I resize a batch to the same size without stretching?

Yes, and there are only two ways: fill or fit. Fill scales until the image covers the box and crops the overflow — on a 4:3 source in a square box that discards 25% of the pixels, on a 3:2 source 33.33%, on a 1:4 strip 75%. Fit scales until the image is inside the box and pads the rest — the same 25%, 33.33% and 75% come back as background instead of as lost pixels. Stretch is the only mode that distorts, and it is also the only one that never loses a pixel, which is why it keeps getting chosen by accident.

Why did my batch ZIP come back with fewer files than I put in?

Because two source files had the same name. Six files from two folders, both starting at IMG_0001.jpg, produced a ZIP with six entries and three distinct names; extracting it left three files, with the later ones overwriting the earlier ones. The archive size does not change, so nothing looks wrong. Fix it at the naming step — prefix each output with its folder name, or number the whole batch in sequence — and count the extracted files against the input count before deleting the originals.