{
  "id": 15153456,
  "title": "My screenshots were smaller as PNG-8 than JPEG, and my photos were 3.8x bigger",
  "url": "https://urgent.news/2026/10/17/my-screenshots-were-smaller-as-png-8-than-jpeg-and-my-photos-were-3",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-17T08:08:03.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/token111/my-screenshots-were-smaller-as-png-8-than-jpeg-and-my-photos-were-38x-bigger-11ee"
  },
  "original_language": "en",
  "account": "For my final-year project, I added a compression step before uploading, encoding everything as JPEG at quality 80. Photos came out fine, but screenshots did not. Text became hazy around every character, and the files were larger than expected. So, I switched to 256-colour PNG, which made the images much larger. By measuring four images, I discovered why these discrepancies occurred.\n\nFirst, screenshots fail the idea that lossy means smaller. A Chinese meeting-notes page with 174 distinct colours was 313,983 bytes as a lossless PNG, 123,658 bytes as JPEG quality 60, and 164,265 bytes at quality 80. As a palette PNG, it was only 116,231 bytes, smaller than both JPEGs and identical pixel for pixel. The palette PNG stores up to 256 colours, then one index per pixel, compressing those indices losslessly. If the image only has 174 colours, nothing needs approximation. Large white areas and text colours also result in long runs of the same index, making it good for lossless compression. With 87.9% of pixels having the same colour as their right-hand neighbour, the table screenshot was 58,317 bytes as a palette PNG versus 111,650 bytes as JPEG quality 80.\n\nHowever, JPEG works by splitting images into 8x8 blocks and storing each block as frequency components. Sharp black-on-white edges result in high-frequency components, leaving ripples around the text. JPEG also stores colour at half resolution, causing halos around coloured status badges. WebP at quality 80 performed better, with less noise and slightly soft glyph edges, but it's still lossy.\n\nFor photos, the palette runs out quickly. The lake photo has 119,846 distinct colours, making the 256-colour palette PNG 447,369 bytes, while JPEG quality 80 was 117,320 bytes, making it 3.8 times larger. The fruit stall was 2.5 times larger as a palette PNG. Only 7.4% of the lake's pixels matched their right neighbour, so the lossless stage had little repetition to work with. Size was not the only issue; without dithering, the smooth cloud gradient turned into visible bands, while with dithering, the bands broke up into fine grain that appeared fuzzy up close. JPEG quality 80 did not show these banding issues.\n\nIn conclusion, photos with many colours and large smooth gradients band when compressed. Tools like ImgIng (https://imging.ai/) use heuristics to guess image types and apply appropriate compression. My project now counts colours before deciding: 256 or fewer go to palette PNG, everything else to WebP. However, this cutoff threshold is crude, and a better one may be needed.",
  "summary": "For my final-year project I added a small \"compress before upload\" step, and I gave it exactly one setting: re-encode everything as JPEG at quality 80. Photos came out fine. Screenshots did not. Text picked up a grey haze around every character, and the files were bigger than I expected for such simple images. So I flipped it and tried saving photos as 256-colour PNG instead, which made them…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "Dev.to",
        "title": "My image compressor picked PNG-8 for screenshots and WebP 75 for photos, so I checked whether it was right",
        "url": "https://urgent.news/2026/10/17/my-image-compressor-picked-png-8-for-screenshots-and-webp-75-for",
        "published": "2026-10-17T08:05:02.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}