A DEV Community article tests two options in Pillow, the Python image library, when saving JPEG files. The first, optimize=True, makes the encoder take an extra pass to build compression tables fitted to the image. The second, progressive=True, stores the file in scans so the picture sharpens as it loads. According to the author, neither option changes the pixels. All 16 outputs matched the plain save when decoded.
On a 4964 × 2782 camera photo at quality 75, optimize cut the file from 772,155 bytes to 704,228 bytes, a saving of 8.8%. Progressive saved 8.1%. At quality 85 on the same photo, optimize saved 3.5% and progressive saved 4.9%. On a 1920 × 1076 resized copy, savings ranged from 1.7% to 3.9%. The author notes that savings shrink as quality rises, and that neither option won in every case.
The CPU cost differed more sharply. On the camera photo at quality 75, a plain save took 27.8 ms, optimize 56.3 ms and progressive 115.3 ms. Optimize roughly doubled the encode time and progressive roughly quadrupled it. The author also saw that progressive files came out the same size whether optimize was on or off, though he did not check the encoder source to explain why.
The author recommends always setting optimize=True and adding progressive=True for photos served on the web. He says progressive was smaller than optimize alone in three of four cases. He did not test images below 1920 px wide, other quality values, grayscale or CMYK sources, mozjpeg, or how quickly progressive files paint in a browser. The tests ran on one machine with one sample photo.
Why it matters
If your site generates JPEGs with Pillow, a single flag can reduce file size without any visible change, since the pixels stay identical. Smaller files mean less data to send to visitors. The gain here was largest at lower quality settings and on the large photo, so results will vary with your own images.
The extra CPU time only matters at volume. For one upload it is negligible, but the author estimates the gap between progressive and optimize adds about 10 minutes of CPU across 10,000 full-size photos. Treat these figures as one person's measurements on one sample, and check them against your own files before changing a pipeline.
Progressive JPEGs also change how an image appears while loading, showing a blurry whole picture first. The article did not measure that experience, so it is worth looking at yourself.
Source: DEV Community. This brief summarises their reporting; read the original for the full detail.