Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why JPEG makes screenshots bigger, not smaller (with numbers)

The usual advice for a screenshot that's too big to share is "save it as JPEG". I tested that on a long page of text, and the JPEG came out larger than the PNG while looking worse. Here's the test, why it happens, and what to use instead. The test I generated a 1280×4000 image of black and grey text on a white background, with some headings and blue links, to imitate a long article capture. Then…

The usual recommendation for shrinking a screenshot too large to share is to save it as JPEG. However, a test using a long page of text showed the JPEG resulted in a larger file size and worse quality than the original PNG. This investigation explores why that happens and suggests better formats to use instead. The test generated a 1280×4000 image of black and grey text on a white background, similar to a lengthy article.

Each format - JPEG, PNG, and WebP - was saved using Python's Pillow library, with varying quality settings. While lower quality JPEGs were visibly worse, they also ended up being larger files than the original PNG. JPEG was designed for photographs with gradual colour changes, not sharp edges like text characters. Its block-based compression system makes it inefficient for text-heavy images.

Lowering the JPEG quality throws away fine patterns, causing noticeable halos around letters. Adding chroma subsampling to a JPEG further degrades coloured text. In contrast, PNG and WebP handle text well due to their efficient compression of repetitive patterns and colours. For sharing or embedding web content, lossless WebP is recommended as it's supported by all modern browsers.

If a PNG is required, reducing the colour palette first and running it through a lossless optimiser can help reduce file size. When a JPEG is necessary, keeping the quality above 80 is advised for text readability. For photos or graphics, JPEG or lossy WebP work better due to their smaller file sizes. The advice focuses on text, UI, and diagrams, recommending using a lossless format for sharp edges and few colours, and a lossy format for gradients and many colours. A quick comparison between formats is suggested when a page contains both.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

LinkedIn job alerts in Slack without logging in to LinkedIn

LinkedIn's own job alerts live in your LinkedIn inbox, need an account, and are hard to share with a team. If you want new postings for a few searches dropped into a Slack channel (a recruiting team…

  • LinkedIn offers job alerts directly in inbox
  • Set up Slack incoming webhook URL for job sharing
  • Use Apify tool or Python script to automate posting

More from Friday 6 November →