PNG, JPEG or WebP for the web
Compare file size, transparency and sharpness using a photo, a logo and an ImgParser screenshot. Download the files to repeat the test.
Three images, four results
Download any version to compare the pixels at full size. The checkerboard shows transparent areas.
Photo
900 × 600 pxLogo
450 × 300 pxScreenshot with text
900 × 600 pxWhich format should you use?
- For photos, try lossy WebP and JPEG. Compare file sizes and inspect fine detail such as foliage, sand or hair. In our coastal sample, lossy WebP is smaller than JPEG with the settings tested here.
- For icons and logos with transparent backgrounds, try PNG or lossless WebP. JPEG has no alpha channel, so our exported logo uses white where the original was transparent. Both WebP versions keep the transparency, and the lossless file is the smallest of the four.
- For screenshots with text, start with PNG or lossless WebP. Inspect small lettering at full size. Lossless WebP preserves the pixels in our ImgParser screenshot and takes up less space than the source PNG.
How we ran the test
We used ImageMagick 7.1.2-36 with WebP support. The three downloadable PNG files above are the inputs. The coastal image was generated for this test, the logo was rasterized from the ImgParser icon, and the screenshot comes from the Spanish version of the converter. We compared the files at the same dimensions with embedded profiles and metadata removed.
Download all three PNG files into one folder and run these commands in Bash. If your terminal starts in zsh, type bash to open a Bash session. JPEG is exported against a white background using 4:2:0 chroma subsampling. Each encoder receives a quality value of 85. The scale depends on the format, so identical values can produce different levels of visual quality.
for sample in costa logotipo captura; do
magick "$sample.png" -background white -alpha remove -alpha off \
-strip -sampling-factor 4:2:0 -quality 85 "$sample.jpg"
magick "$sample.png" -strip -quality 85 "$sample.webp"
magick "$sample.png" -strip -define webp:lossless=true \
-define webp:exact=true -quality 85 "$sample-sin-perdida.webp"
done
File size depends on the image, settings and encoder version. To compare your own files, try the PNG to WebP converter or the PNG to JPEG converter. Follow the terminal recipe to process a whole folder.
See the format specifications and encoding options. PNG · JPEG · WebP in ImageMagick