JPG, PNG and WebP Compared

Six downloadable inputs and actual format exports show how photographs, text, patterns and noise change file-size results.

Last checked October 20, 2026

Same pixels, different files

Actual reference-encoder exports, measured 2026-10-20. Every input is 1200 × 900 pixels, flattened onto white. JPG and WebP use quality 85; PNG uses lossless encoding. Equal quality numbers do not mean equal visual quality across formats.

Download an input or an output to inspect it at 100%.
Test imageJPGPNGWebP
Porcelain cup photographPhotograph47,070 B656,075 B25,952 B
Coffee and fine texturePhotograph186,739 B1,777,392 B128,562 B
Text and sharp edgesSynthetic test graphic34,870 B27,844 B12,646 B
Fine woven patternSynthetic test graphic477,374 B32,538 B452,292 B
Transparent graphicSynthetic test graphic29,182 B25,219 B11,008 B
Seeded random noiseSynthetic stress test; not a photograph774,165 B3,246,714 B813,096 B
Porcelain cup photograph
Porcelain cup photograph. Preview is the JPG; compare the downloadable outputs.
Coffee and fine texture
Coffee and fine texture. Preview is the JPG; compare the downloadable outputs.
Text and sharp edges
Text and sharp edges. Preview is the JPG; compare the downloadable outputs.
Fine woven pattern
Fine woven pattern. Preview is the JPG; compare the downloadable outputs.
Transparent graphic
Transparent graphic. Preview is the JPG; compare the downloadable outputs.
Seeded random noise
Seeded random noise. Preview is the JPG; compare the downloadable outputs.

The woven pattern favors PNG; the seeded noise favors JPG over WebP. These fixtures demonstrate dependence on image content, not a universal format ranking. Your browser and marketplace can encode differently.

Image sources and reproduction

Photographs: Coffee Cup, The Metropolitan Museum of Art; Coffee cup and coffee bean, mcfoodie. Both are CC0. They are third-party test material, not photographs taken by this project. Pattern, text, transparency and noise fixtures are generated tests.

Measured 2026-10-20 with sharp 0.35.4, libvips 8.18.6, Node 24.13.1. Download all dimensions, byte counts and SHA-256 hashes. Reproduction script.

What stayed constant

Every row uses one normalized PNG input. Dimensions, background and source pixels remain unchanged while the format changes. Photographs are fitted to the canvas; the generated cases already use the target size. The normalized inputs are published so a repeat test does not depend on recreating a museum download or a drawing.

The transparent test graphic is deliberately flattened to white before the three-format comparison. Its byte counts are therefore not an alpha-preservation test. The file-quality guide separately shows the transparent source and white/black composites.

Interpret the trade-off

Repeated structures can compress efficiently in PNG. Random noise contains many unpredictable pixels and is deliberately difficult to compress. A photograph of a real fabric or a detailed label can behave differently from either generated fixture.

Byte counts are reproducible; acceptable quality is a viewing decision. Compare important detail at normal display size and at 100%. No visual-quality score, marketplace acceptance, sales improvement or device-speed claim was measured.

  1. Choose a destination-supported format before optimizing bytes.
  2. Compare outputs from the same input and dimensions.
  3. Inspect label text, edges and texture rather than only file size.
  4. Repeat with a second relevant image before committing to a batch setting.

Sources checked