PDF to JPG versus PNG: measured quality and file-size test

We exported the same three-page PDF as JPG and PNG in Chrome. Every page had identical pixel dimensions, while compression cost varied sharply with photo, interface, and flat-graphic content.

Controlled test result

PNG was 4.28 times larger overall; JPG changed rendered pixels

JPG ZIP235,968 bytes for three pages
PNG ZIP1,008,947 bytes for three pages
DimensionsEvery output was 1224 x 1584 pixels
Largest gapThe photo PNG was 798,826 bytes versus 104,517 bytes for JPG

Fixture and reproducible method

The 907,216-byte source PDF has three Letter pages. Page one contains a generated photo-style landscape; page two contains a small-text interface screenshot; page three contains a flat-color graphic with thin rules and labels. Each page also has vector heading and footer text, so the source includes both embedded raster material and PDF text.

  1. Generate the source with scripts/evidence/generate_fixtures.py.
  2. Load the current Converttwo application in Chrome 152.0.7977.83.
  3. Call the exported pdfToImages function through the served application once for JPG and once for PNG.
  4. Inspect both ZIP archives, decode every image, and compare corresponding JPG and PNG pixels.

Both conversions used PDF.js scale 2. Letter pages measuring 612 x 792 PDF points therefore became 1224 x 1584 pixels. JPG used browser JPEG quality 0.9. PNG encoded the same rendered canvas losslessly. Both paths rasterize text and vectors; neither output retains searchable PDF text.

Photo content produced the largest file-size difference

JPG page 1: 104,517 bytes in the ZIP
PNG page 1: 798,826 bytes in the ZIP

The photo PNG was 7.64 times the JPG size. Against the PNG rendering, the JPG had a mean absolute channel difference of 0.590 and a maximum channel difference of 64 on a 0-255 scale. At normal page-preview size the pair looked very similar, but JPG introduced measurable changes around textured and high-contrast regions.

PNG’s size penalty was smaller on the interface page

JPG page 2: 66,367 bytes
PNG page 2: 115,666 bytes

The PNG was 1.74 times the JPG size on this mostly white page. The JPG differed on 14.22% of pixels, with a mean absolute channel difference of 0.182. Thin text and rules remained readable in this controlled export, but PNG retained the rendered pixel values exactly and avoids adding JPEG ringing around sharp boundaries.

Measured results by content type

Values measured inside the published ZIP files
PDF pageJPG bytesPNG bytesPNG/JPG ratioJPG changed pixelsMean channel difference
1: photo-style image104,517798,8267.64x37.46%0.590
2: small-text interface66,367115,6661.74x14.22%0.182
3: flat-color graphic64,67294,0431.45x40.49%0.406
Whole ZIP235,9681,008,9474.28xThree 1224 x 1584 images in each archive

“Changed pixels” counts any nonzero RGB difference between a decoded JPG and the corresponding PNG. It does not mean that every changed pixel is visibly objectionable. The mean channel difference helps show that most changes were small even where many pixels differed.

Which output should you choose?

Choose JPG when smaller downloads matter and pages are dominated by photographs, gradients, or ordinary scans. Choose PNG when text, one-pixel rules, diagrams, or repeated image editing make lossless rendered pixels more valuable than storage. For this fixture, PNG’s relative penalty was much larger on the photograph than on either designed page.

Limit of this test

These results apply to this three-page fixture, Chrome 152, the current PDF.js rendering path, and the current quality settings. Different page sizes, fonts, photos, browser encoders, and PDF complexity will produce different byte counts. PNG did not preserve PDF vectors or text; it only preserved the pixels produced by this render.

Export for the content you have

Use JPG for compact photographic pages or PNG for lossless raster text and graphics, then inspect the downloaded images at 100%.

Open PDF page export

Related evidence and guidance