JPG, PNG, WebP or AVIF? Choosing the Right Image Format
Picking an image format is mostly about two questions: what kind of image is it, and where will it be opened. A format that is perfect for a website can be rejected by a government upload form, and a format that is ideal for a logo can make a photo ten times larger than necessary. Here is how the four formats you are most likely to meet actually differ.
Lossy vs. lossless, in one paragraph
Lossless compression stores the image so that decoding gives back exactly the same pixels, like a ZIP file. Lossy compression throws away information the eye is unlikely to miss, which makes files much smaller but means every save at a lossy setting discards a little more. Photos tolerate lossy compression very well. Text, sharp lines, and flat color areas do not: lossy codecs produce visible smudges and halos around them.
The four formats
JPEG (JPG)
Standardized in 1992 and still the universal photo format. JPEG converts the image into a brightness channel and two color channels, usually stores the color channels at half resolution horizontally and vertically (called 4:2:0 chroma subsampling, which works because our eyes are less sensitive to color detail than to brightness), then splits the image into 8×8 pixel blocks and discards fine detail in each block according to the quality setting.
- Lossy only, 8 bits per channel, no transparency.
- Strengths: opens literally everywhere; excellent for photos.
- Weaknesses: blocky artifacts at low quality, colored fringes around red text and thin lines because of subsampling, quality loss every time it is re-saved.
PNG
Created in the mid-1990s as a patent-free replacement for GIF. PNG is lossless: it predicts each pixel from its neighbors and compresses the differences with the same Deflate algorithm used in ZIP.
- Lossless, supports full alpha transparency, up to 16 bits per channel, or palette mode with up to 256 colors.
- Strengths: perfect for screenshots, logos, diagrams, text, and anything you will edit again.
- Weaknesses: photos become very large, often 5–10× a good JPEG, because camera noise is hard to compress losslessly.
WebP
Released by Google in 2010. WebP has two separate modes: a lossy mode based on the VP8 video codec, and a lossless mode with its own algorithm. Both support transparency, and it also supports animation.
- Lossy WebP is typically around 25–35% smaller than JPEG at similar visual quality; lossless WebP is usually smaller than PNG.
- Supported by all current major browsers.
- Weakness: outside browsers, support is patchier. Some older editors, office software, print services, and many upload forms still refuse it. Lossy WebP always uses 4:2:0 subsampling, so it shares JPEG's color fringing on sharp edges.
AVIF
Finalized in 2019, AVIF stores images compressed with the AV1 video codec inside a HEIF container (the same container family as iPhone HEIC files). It is royalty-free.
- Lossy and lossless, transparency, 10- and 12-bit color, HDR.
- Often substantially smaller than JPEG at equal quality, especially at low file sizes, where it degrades into smooth blur rather than blocks.
- Supported in current Chrome, Edge, Firefox, and Safari (Safari from version 16).
- Weaknesses: encoding is slow and CPU-heavy; support in desktop software and upload forms is still limited; it can smooth away fine texture like skin pores or fabric at aggressive settings.
Side-by-side comparison
| JPEG | PNG | WebP | AVIF | |
|---|---|---|---|---|
| Compression | Lossy | Lossless | Lossy or lossless | Lossy or lossless |
| Transparency | No | Yes | Yes | Yes |
| Animation | No | Only as APNG | Yes | Yes |
| Max bit depth | 8 | 16 | 8 | 12 |
| Photo size (relative) | Baseline | Much larger | Smaller | Smallest |
| Browsers | All | All | All current | All current |
| Upload forms, office apps | Universal | Universal | Inconsistent | Often rejected |
Which format for which job
| Situation | Best choice | Why |
|---|---|---|
| Uploading an ID photo, résumé photo, or document scan to a form | JPEG | Accepted everywhere; easy to hit size limits |
| Screenshot with text, UI, or code | PNG | Text stays crisp; JPEG blurs it |
| Logo or icon with a transparent background | PNG (or SVG if you have the vector) | Transparency and sharp edges |
| Photos on your own website | AVIF or WebP, with JPEG fallback | Faster pages; browsers support both |
| Master copy you will edit later | PNG or the camera original | No generational loss |
| Sending to someone with unknown software | JPEG (photos) or PNG (graphics) | Guaranteed to open |
Common mistakes
- Converting a JPEG to PNG to "improve quality." The detail lost during JPEG compression does not come back. You simply get a larger file containing the same artifacts.
- Saving screenshots as JPEG. Text gets fuzzy halos, and the file is often not even smaller than a PNG of the same flat-color screen.
- Converting PNG with transparency to JPEG. JPEG has no alpha channel, so transparent areas become a solid color, usually white or black. Check the background before you send a logo.
- Renaming the extension. Changing
photo.webptophoto.jpgdoes not convert anything. Some sites detect the real format and reject it; others accept it and break later. - Re-saving JPEGs repeatedly. Each save at less than maximum quality compounds artifacts. Edit from the original and export once.
Why sites still ask for JPG or PNG
Government portals, school systems, and recruitment sites often process uploads with older server software, generate PDFs from them, or print them. JPEG and PNG work with every library and printer driver; newer formats might not. Restricting uploads to two formats is the safe choice from their side, so convert before you submit rather than hoping a WebP slips through.
How to do it with FilePrivy
Downloaded a WebP or AVIF that a form will not take? WebP to JPG and AVIF to JPG convert it to the universally accepted format. Use PNG to JPG to shrink a photo saved as PNG (transparent areas become white) and JPG to PNG when software requires PNG. Conversion runs in your browser, so the images stay on your device.