{
  "id": 20140596,
  "title": "PNG vs JPEG for PDF pages: the chart page agreed, the text page didn't",
  "url": "https://urgent.news/2026/11/15/png-vs-jpeg-for-pdf-pages-the-chart-page-agreed-the-text-page-didnt",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-15T08:09:24.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/token111/png-vs-jpeg-for-pdf-pages-the-chart-page-agreed-the-text-page-didnt-591k"
  },
  "original_language": "en",
  "account": "When saving PDF pages as images for PDF files, PNG is generally smaller than JPEG, according to a widely held belief. However, this rule is not consistently applicable. For instance, on a three-page sample, it held true only for the chart page. That page, featuring flat colors and thin lines, measured 127,051 bytes as PNG versus 178,232 bytes as JPEG at quality 75. Conversely, a dense text page was 838,404 bytes in PNG format, approximately 5% larger than JPEG at quality 92 (796,608 bytes). Lossless WebP emerged as the smallest file on both pages for both the text and chart pages.\n\nThis sample consisted of a three-page A4 PDF. The first page featured Chinese body text in various sizes (10.5, 9, 7.5, 6, and 5 pt), two small English lines, and a table drawn with 0.3 pt rules. The second page contained vector bar, line, and pie charts, with labels ranging from 6 to 7.5 pt. The third page included a large photograph, a cropped detail, and some 8 pt text. All elements were created for the test; however, the photograph on the third page was borrowed from a CC0 image by Bonnie Moreland from Wikimedia Commons. Each page underwent processing through poppler at 216 DPI onto a white canvas (1786×2526 pixels), then saved into various formats using Pillow and pngquant. This single pass per setting was completed on an Apple-silicon Mac, ensuring no scans, handwriting, or print-ready files were involved. Consequently, all byte figures presented refer solely to this specific sample.\n\nOn the text page, PNG resulted in a file size of 838,404 bytes, while JPEG at quality 75 produced a file size of 535,729 bytes (37.86 dB). At quality 85, JPEG expanded to 647,884 bytes (41.54 dB), and at quality 92, it reached 796,608 bytes (45.92 dB). In contrast, lossless WebP consistently produced smaller files on both text and chart pages, with sizes of 161,212 bytes on the text page and 37,390 bytes on the chart page. On the text page, lossless WebP was roughly a fifth the size of PNG, and on the chart page, it was under 30% the size. Notably, lossless WebP also came in smaller than the 256-color palette PNG on both pages, which is a lossy format. The photo page exhibited no surprises, with PNG being eight times larger than JPEG at quality 75, and lossless WebP performing worse than every JPEG level.\n\nBoth pages had a high percentage of white space (80%). The chart page had a slightly higher percentage of white space (82%) compared to the text page (81%). Additionally, the chart page displayed more distinct colors, approximately 2117 compared to the text page's 447. Thus, neither the increased background nor the fewer colors could determine which page PNG would be smaller. Instead, the distribution of non-white pixels played a significant role. When dividing each page into 8×8 blocks that JPEG processes, 93.0% of the chart page's blocks were a single flat color, while only 75.5% of the text page's blocks were. Therefore, about a quarter of the text page's blocks contained edges, as opposed to 7.0% on the chart page. My interpretation is that PNG must precisely preserve every edge pixel, while JPEG at quality 92 is permitted to approximate them. Consequently, pages with more scattered edges benefit more from the lossless format. However, this observation is based solely on these three pages, and I am uncertain about the underlying reason. Additionally, lossless WebP exhibited superior performance with the same edges compared to PNG. Lastly, the export tool used also affected the results. Using a different browser export tool (ImgIng at imging.ai) with three DPI options (144, 216, 300) led to differing file sizes on the chart page; PNG was larger than JPEG on that page, so the encoder within the tool can vary. For notes, it is recommended to test slides that are predominantly charts, diagrams, and flat colors, as PNG would be the smaller lossless choice and lossless WebP would be even smaller. For dense text pages, lossless WebP emerged as the clear winner, but only if the destination accepts WebP. If not, JPEG at quality 92 was not larger than PNG on the text page. Lastly, photos should be saved as JPEG. A quick check can be performed by rendering one page of each kind at the desired DPI, saving the same pixels as PNG, JPEG q92, and lossless WebP, and comparing the byte counts. Finally, zoom in on the smallest text and ensure the letters still appear as intended, regardless of the tool or format chosen.",
  "summary": "\"Save text as PNG, it's smaller than JPEG\" is a rule of thumb for storing PDF pages as images, whether that's lecture slides for revision notes or a paper's figures. On a three-page sample, it held for the chart page only. That page, with flat colours and thin lines, came out at 127,051 bytes as PNG against 178,232 bytes as JPEG at quality 75. The dense small-text page went the other way: 838,404…",
  "key_points": [
    "PNG generally smaller than JPEG for chart page (127,051 bytes vs 178,232 bytes)",
    "Dense text page 5% larger in PNG (838,404 bytes vs 796,608 bytes)",
    "Lossless WebP smallest file for both text and chart pages"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "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."
}