Reference
Image file formats, explained and measured
Checked against the sources on
What is here
One page per image format AltFTool can convert, answering what the format is and how to open it, and one page per pair people actually choose between. Facts come from the format's own specification or registration; file sizes come from real encodes in a browser, not from marketing averages.
Which image format should you use?
| Your job | Use | Why | Details |
|---|---|---|---|
| Photo you will email, upload to a form or print | JPG | Opens almost everywhere; some upload forms accept nothing else. | PNG vs JPG |
| Photo on your own web page | WebP, or AVIF with a fallback | Smaller than JPG at similar fidelity in our measurements. | JPG vs WebP |
| Screenshot, chart or text that must stay sharp | PNG | Lossless, and flat colour compresses well. | What is a PNG file? |
| Logo or cut-out with a transparent background | PNG to keep, WebP for the web | JPG cannot store transparency. | PNG vs WebP |
| HDR or 10-bit photo for the web | AVIF | AVIF carries HDR; lossy WebP is 8-bit. | WebP vs AVIF |
| Photo that arrived as HEIC | Keep the HEIC, send a JPG copy | Many browsers and forms may not open HEIC. | HEIC vs JPG |
Formats
- What is a PNG file?PNGWhat a PNG file is: lossless W3C format with transparency and APNG animation, how to open it, and measured sizes for a photo and a graphic.
- What is a JPEG file?JPEGWhat a JPG or JPEG file is: lossy ITU-T T.81 photo compression with no transparency, how to open it, and measured sizes at two quality settings.
- What is a WebP file?WebPWhat a WebP file is (RFC 9649): lossy or lossless, with transparency and animation, how to open one, and measured sizes from a browser encoder.
- What is an AVIF file?AVIFWhat an AVIF file is: AV1 images in a HEIF container, which browsers open it, why some cannot save it, and measured sizes for a sample photo.
- What is a HEIC file?HEICWhat a HEIC file is: HEIF with HEVC coding (image/heic), why browsers may not open it, how to view or convert one, and a measured example.
Comparisons
- PNG vs JPG: which one should you save as?PNG or JPG? Lossless vs lossy, transparency and file size, with a decision table and measured sizes for the same photo and graphic saved both ways.
- WebP vs AVIF: smaller files, or easier to make?WebP or AVIF for the web? File size at similar fidelity, browser support dates, which one a browser can create, and a decision table.
- JPG vs WebP: is it worth switching?JPG or WebP? Size at similar fidelity, transparency, where JPG is still required, and measured sizes for a photo and a graphic.
- HEIC vs JPG: keep the HEIC or convert it?HEIC or JPG? Storage vs compatibility, what converting costs in size and quality, and a measured example from the HEIC to JPG converter.
- PNG vs WebP: when does WebP actually save space?PNG or WebP? Lossless and lossy WebP against PNG, transparency, and measured sizes for a photo and a flat graphic, with a decision table.
One photo, five formats
The same synthetic 960 x 640 photo in each format. PNG, JPEG and WebP were written by the browser's canvas; the AVIF and HEIC files were made outside the site because this browser cannot write them.
| Format | Bytes | Size | Fidelity to the original |
|---|---|---|---|
| PNG (lossless) | 1,275,225 | 1245 KB | identical pixels |
| JPEG, quality 0.82 | 86,531 | 84.5 KB | 36.1 dB |
| WebP, quality 0.82 | 71,574 | 69.9 KB | 36.5 dB |
| AVIF (reference file) | 57,992 | 56.6 KB | did not decode |
| HEIC (reference file) | 49,461 | 48.3 KB | browser could not decode it |
How these pages work
Every fact row on a format page names the document it was read from: the W3C PNG Specification, RFC 9649 for WebP, ITU-T T.81 and JFIF for JPEG, the AOMedia AVIF specification, and the IANA media-type registrations. Browser support is quoted from MDN with the date it was read, because support changes. Where a primary document could not be opened, the page says what it leaves out instead of filling the gap.
The file sizes come from a script in the AltFTool repository (scripts/formats/measure.mjs) that encodes two fixed sample images with the same browser canvas call the site's image tools use, at the tools' default settings (plus WebP at 0.90 and 1.0 to show where its lossless mode starts), then decodes each file and measures how far it drifted from the original. Fidelity is reported as PSNR in decibels against the original pixels, both composited over white; higher is closer. KB on these pages is 1,024 bytes. A page whose measurement is missing is kept out of search results until the script runs again.
- Browser: Chromium 153.0.8010.12 (through Playwright 1.63.0); HEIC decoding through heic2any 0.0.4. Measured on 13 November 2026.
- Synthetic photo: A 960 x 640 opaque continuous-tone landscape with film grain, drawn from a seeded PRNG. Stands in for a camera photo. Dedicated to the public domain (CC0).
- Synthetic graphic with transparency: A 960 x 640 card with flat colours, hard edges, text-like bars, a bar chart, an anti-aliased dot and a soft shadow on a transparent background. Stands in for a screenshot, logo or UI image. Dedicated to the public domain (CC0).
- photo.heic: made outside the site with pillow-heif 1.8.1 (libheif 1.23.6, x265 4.3+1-e9b8812), Pillow 13.0.0; quality 43 (pillow-heif scale 0-100), RGB 8-bit; picked as the quality whose PSNR, decoded by libheif 1.23.6 and measured with FFmpeg, came nearest the WebP 0.82 encode (about 36.2 dB against 36.5 dB). Decoded by heic2any in the browser, the same file measures lower.
- photo.avif: made outside the site with FFmpeg 6.1.1 (Ubuntu 7:6.1.1-3ubuntu5) with libaom-av1 3.8.2; still picture, crf 17, cpu-used 4, one thread, yuv420p; picked as the crf whose PSNR, decoded and measured with FFmpeg, came nearest the WebP 0.82 encode of the same sample.
A synthetic photo is not a real one, and another browser's encoder will produce other byte counts. Treat each figure as one reproducible example, not as an average.
Need a different format?
Convert between JPG, PNG and WebP in your browser tab, and to AVIF where the browser supports it. HEIC photos have their own converter.