HandyVale › Guides

Batch Convert PNG to JPG: 10 of 12 Files Got Bigger

Updated 2026-10-31 · handyvale.com

Short answer

Twelve PNGs, one folder, one quality setting: 11,091,603 bytes in, 2,689,721 out — 75.75% smaller. Ten of the twelve files came out bigger than they went in, and the median file grew 2.79×. The total fell because two photographic files were 97.39% of the input bytes; strip those two and the other ten went from 289,741 bytes to 677,399.

A batch total is an average over files nobody weighed. Judge the run by the total and you ship a folder where the screenshot tripled and the grayscale ramp got 18× heavier, while the two photos pay for all of it.

Browser-side processing — your images are never uploaded · No login · No watermark · No file-size or use limit

The twelve files, before and after

One pass per file, quality 92, no resizing, no cropping, no renaming. The same settings a batch tool would apply to a whole folder.

FilePNGJPG q92Change
logo 1600×120050,00162,3141.25×
ui 1440×90015,19958,1293.82×
photo 2400×16007,556,651958,1480.13×
icon 512×51215,09816,2741.08×
gradient 2000×10008,27277,0589.32×
line art 1700×2200180,303315,0381.75×
palette 1200×8006,45331,4934.88×
grayscale 1600×12004,31578,27818.14×
16-bit 1200×9004,26119,4484.56×
noise 1200×9003,245,2111,054,1740.32×
small 320×2403,0264,4241.46×
unicode name 800×6002,81314,9435.31×

Measured 2026-10-31, Pillow 13.0.0 on Python 3.13.12, one Windows machine, one pass per file. The assets are synthetic: two are photographic (a gradient scene and sensor-style noise), ten are flat colour or line art. That mix is the subject of the test, not a sample of your folder.

Why a flat PNG cannot win

PNG stores exact pixel values and compresses them without loss, so a flat area costs almost nothing. A grayscale ramp therefore costs 0.0022 bytes per pixel; a flat icon costs 0.0576; the photographic file costs 1.9679 and the noise file 3.0048. JPG does not work that way. It cuts the image into 8×8 blocks, transforms each one, and spends bits per block whether the block is a sky or a wall.

That gives the encoder a floor. On the ten flat files the floor landed between 0.018 and 0.084 bytes per pixel — more than the PNG was paying. On the two photographic files JPG paid 0.25 and 0.98 against 1.97 and 3.00, which is where the whole saving came from.

The dividing line in this batch sits between 0.0576 and 1.9679 bytes per pixel. Everything above it shrank; everything below it grew, from 1.08× to 18.14×. The worst case is the 1,600-pixel grayscale ramp: 4,315 bytes as PNG, 78,278 as JPG. Eighteen times the bytes to store a file that was already 4 KB.

Where the bytes sit, before and after PNG in · 11,091,603 B 10,801,862 B · two photos 97.39% of the input · the other ten files are 289,741 B (2.61%) JPG out · 2,689,721 B 2,012,322 B 677,399 B the ten flat files went 289,741 → 677,399 B, 2.34× total fell 75.75%; median file grew 2.79× measured 2026-10-31, quality 92, 12 files, one pass each

The two dark segments are the same two files. Everything else in the folder got heavier.

One quality setting, four kinds of file

A batch applies a single number to everything in the queue. Here is what that number does to four of the files, in bytes.

Fileq60q75q85q92q95
photo177,063310,794525,247958,1481,398,407
line art193,600224,572262,777315,038369,064
ui38,84444,20050,14058,12965,393
noise513,566652,734820,9611,054,1741,273,793

The photo pays 5.4× for the move from 60 to 92 (177,063 to 958,148). Line art pays 1.63× over the same range and gains the most: mean absolute error per channel falls from 0.583 levels to 0.156, then to 0.096 at 95. Text edges are where the number is visible.

Noise is the file that ignores the slider. Its error sits at 49.9 levels at quality 60 and 46.4 at 92, a 3.5-level improvement for 540,608 extra bytes. If a folder holds scanned grain, film texture or dithering, that is the group where quality buys almost nothing.

Chroma is halved at every one of those settings

I checked the frame header of each output: the luma component is sampled 2×2, chroma 1×1. Quality 95 does not change it on this encoder. Asking for full chroma resolution on the same twelve files costs 4,856,176 bytes against 2,689,721, a rise of 80.55%.

Whether that is worth paying depends on the content, and the difference is easy to measure. On a page of coloured headings, chroma error drops from 0.468 levels to 0.1955 for 43.3% more bytes. On a black-text invoice page the chroma error is 0.0 either way — and the same request still adds 41,542 bytes, 13.2% of that file, for nothing at all.

The file that fails without a message: 16-bit PNG

My test folder held a 16-bit grayscale ramp with 1,200 distinct values in a single row. Converting it to 8-bit can go two ways, and both end in a JPG that looks plausible in a thumbnail.

The route my encoder took clipped instead of scaling: values above 255 were pinned at 255, so 99.58% of that row became white and the file kept 6 distinct levels. The JPG weighs 19,448 bytes and holds 7 levels. Scaling the same ramp properly gives 256 levels, a PNG of 3,037 bytes, and a JPG of 47,601 — 15.7× the PNG, for a gradient that is actually a gradient.

Same input, same output format, two different pictures. Nothing in the interface warns you, and the original is the only copy that still has the ramp.

The one decision a batch makes for you: the fill colour

The logo in the folder is 1,920,000 pixels, 1,440,569 of them fully transparent. A JPG has no alpha plane, so those pixels have to become a colour, and the tool picks it before you see a preview. On the route that drops alpha, all 1,440,569 came out black; flattening onto white put all of them at white.

Both are defensible and they are not the same picture. The wordmark is 17,798 white pixels: on a white fill it disappears, on a black fill it survives with a black box behind the disc. This is the reason the fill colour matters more in a batch than for a single file — you choose once and it applies to every transparent PNG in the queue. If you need the alpha itself, the conversion is the wrong tool; that road is the other direction.

Names, resolution tags, and the clock

Twelve names, one space, one non-ASCII stem, no collisions after lowercasing. A folder that already holds logo.png and logo.jpg collapses to one logo.jpg, which is arithmetic on names rather than something I ran against a tool — I did not test any vendor's collision handling and I am not going to guess at it.

Resolution is the quiet one. The 300 dpi tag on the test PNG did not survive a default JPG write — the output carried no dpi record at all. Pass the value through and 300 comes back as 300. If a batch feeds a print workflow, that tag is the difference between a 2-inch and a 6-inch print of the same pixels.

The whole folder took 588.4 ms including PNG decode, about 49 ms per file. Two hundred files would land near 9.8 s if the cost stays linear (588.4 ÷ 12 × 200 = 9,807 ms). That is arithmetic on one measurement, not a benchmark of anything you own.

Running a batch without the surprises

  1. Measure the folder first: file bytes ÷ pixel count. Under roughly 0.1 bytes per pixel, JPG will probably make it heavier.
  2. Check bit depth and alpha before you queue anything. A 16-bit file and a transparent file each need a decision the batch will otherwise make silently.
  3. Choose the fill colour first, and look at one transparent file on the background it will actually sit on.
  4. Split the queue by content, not by folder: photos at 85–92, line art and screenshots at 92 or above, grain and noise wherever the byte budget allows.
  5. Export three files and compare them against the originals at 100%, not in a thumbnail grid.
  6. Keep the PNGs. Alpha and bit depth do not come back from the JPG.
Your call, not ours: whether 387,658 extra bytes matter. A one-off folder headed for an upload form can absorb it without anyone noticing. A site asset directory rebuilt every week cannot — that is 2.34× the size it started at, every time.
Your call, not ours: which of the two 16-bit outcomes your tool produces. Run one 16-bit file through it and read the histogram; I can tell you what my encoder did to my ramp, and nothing about yours.

Related: what actually shrinks a PNG, what the quality slider does to one file, resizing a whole folder.

Questions

Does compressing a JPEG reduce image quality?

Yes, and the size of the loss depends on the content more than the slider. On the line-art page the mean absolute error per channel was 0.583 levels at quality 60, 0.156 at 92 and 0.096 at 95. On the photographic file the same settings sat between 4.86 and 4.29 levels, because the image was already noisy enough to hide the error.

Why did my PNG get bigger after converting to JPG?

Because the PNG was cheap to store. A flat-colour PNG can cost 0.0022 bytes per pixel, while a JPG spends 0.018 to 0.084 bytes per pixel on the same content no matter how simple it is. Ten of the twelve files in this test grew, from 1.08× to 18.14×.

What quality setting should a mixed batch use?

Split the queue by content first, then pick. Line art and screenshots want 92 or higher: 0.156 levels of error at 92 against 0.583 at 60. Photos sit between 85 and 92, which on the test file means 525,247 to 958,148 bytes. Grain and noise gain 3.5 levels for 540,608 extra bytes, so pick the smallest number you can stand.

Does batch conversion keep transparency?

No. Every JPG is opaque. The 1,440,569 transparent pixels in the test logo came out as one solid colour — black when alpha was dropped, white when the file was flattened onto white. Set the fill colour before the batch runs, because the preview will look right either way.