DEV Community

Cover image for Image Compression Is a Trade-Off, Not a Contest
Pocket PDF
Pocket PDF

Posted on Edited on AI-assisted

Image Compression Is a Trade-Off, Not a Contest

A 16,917 KB image became 471 KB. That's impressive. It also isn't the whole story.

Writing
Image Compression Is a Trade-Off, Not a Contest

A large image file can be annoying. It takes longer to load, occupies more storage and makes email attachments unnecessarily heavy.

So naturally, the first instinct is to compress it as much as possible.

That can work. Until the image starts looking worse.

A real compression test

I tested a 3200 × 2400 PNG photograph.

Version File size
Original PNG 16,917 KB
JPEG quality 55 471 KB

That's a substantial reduction.

The exported JPEG is much smaller, but the result still needs a visual inspection. Quality 55 is a setting, not a promise that every photograph will look acceptable.

PNG, JPEG and WebP aren't interchangeable

The same 1600 × 1200 source image produced these results:

Format Setting Size
PNG Original 4,231 KB
JPEG Quality 90 659 KB
WebP Quality 90 739 KB

JPEG was smaller than WebP in this particular test.

That doesn't establish a universal ranking. Different images, encoders and export settings can produce different results.

A sensible compression workflow

Keep the original.

Decide where the image will be displayed.

Export a test version.

Compare fine details, edges and texture.

Check the actual file size.

Keep the version that meets both requirements.

Don't judge a photograph exclusively at thumbnail size.

One limitation worth remembering

Compression does not guarantee metadata removal.

If a photograph contains EXIF information, changing its format or reducing its size shouldn't be treated as proof that all metadata has disappeared.

Check metadata separately when it matters.

Who should use what?

PNG: Useful when transparency or lossless image preservation matters.

JPEG: A practical choice for many photographs and broadly compatible workflows.

WebP: Worth testing for web delivery, especially when your destination supports it.

There isn't one correct export for every situation.

Try it with an actual image

Pocket PDF's image compressor processes files in the browser. You can test an export and inspect the resulting file yourself.

Original test data and comparisons: https://pocketpdf-notes.pages.dev/image-resolution-vs-pdf-size-four-tests/

The useful result isn't the smallest possible file. It's the smallest file that still looks right for its intended use.

Destination: Notes original. Dev.to canonical URL must point to the Notes article.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.