Basics
PNG, JPG or WebP: choose with a downloadable example
Choose an image format for transparency, readable detail and destination compatibility. Inspect our source and encoded files.
Choose the format after checking what the receiving website or app accepts. Then decide whether you need transparency and whether changing pixel values is acceptable. A smaller file is useful only if the result still does its job.
A practical decision sequence
- The destination requires a format: use it, and test the downloaded result there. WebP to JPG is useful when an upload form rejects WebP.
- Transparency is needed: JPEG cannot keep it. Try PNG or WebP and check soft edges against both light and dark backgrounds.
- Exact pixels matter: for a screenshot, diagram or source you will edit again, compare PNG with lossless WebP. Lossy export can change fine lines and text.
- Some pixel changes are acceptable: compare JPEG and lossy WebP at the intended display size. Keep the original and export each candidate from it, rather than repeatedly converting the previous output.
A palette PNG can have up to 256 colour entries with transparency values per entry. It is not necessarily limited to one transparent colour; reducing a full-colour image to that palette can still discard detail. The PNG specification defines these options.
Inspect a real, reproducible sample
We created an 800 × 600 synthetic chart with a gradient, sharp colour boundaries and seeded noise. It is not a photograph or a representative image collection. These are exact file lengths, generated on 1 October 2026 with Sharp 0.35.3/libvips 8.18.3:
| File / Archivo | Encoder settings / Ajustes | Bytes |
|---|---|---|
| PNG source | compressionLevel 9, lossless | 272855 |
| JPEG | quality 80, 4:2:0 | 63406 |
| WebP | quality 80, effort 4 | 40808 |
| WebP lossless | lossless, effort 4 | 93024 |
| AVIF | quality 50, effort 4, 4:4:4 | 17608 |
Download the generator and complete settings, versions and checksums. In an empty directory, install sharp@0.35.3, save the generator and run node generate-formats.mjs. Different codec versions can produce different bytes.
PNG and lossless WebP decoded to the original RGB pixels in our check. The JPEG, lossy WebP and AVIF outputs did not. Their quality numbers are not equivalent quality levels across encoders; this table does not establish a universal winner or equal visual quality. Open the files and inspect the gradient and high-contrast boundaries.
Try your own file in OpenImages
Download the source PNG, open PNG to WebP and select it. Export, then reopen both images in Compare Images. Check dimensions, readable details and the result at its intended size. The browser encoder used by the tool differs from Sharp, so its bytes can differ from this reference table.
For a JPEG source, use JPG to WebP and retain the camera original. Turning JPEG into PNG does not restore discarded detail. If the converted file is larger or unacceptable visually, keep the original or change the settings.
See Google’s WebP format explanation for the distinction between lossy and lossless coding.
Related tools
Frequently asked questions
Does WebP always make a file smaller?
No. Content, encoding mode and settings matter. Compare the actual output with the source and inspect the result.
Does JPEG to PNG restore quality?
No. Lossless storage preserves the decoded result, including any earlier JPEG artefacts.