Choosing an image format
PNG vs JPG vs WebP vs SVG (and when AVIF matters)
What PNG, JPEG, WebP, AVIF and SVG actually store, where each is supported in practice, which to pick for photos, screenshots, logos and transparent graphics, and the conversion mistakes that quietly damage images.
- By HelpMeJPG editorial team
- Published
- Updated
- 9 min read
On this page
Most image problems on the web are format problems in disguise: a fuzzy logo saved as a JPEG, a two-megabyte photo exported as a PNG, a transparent graphic that arrived inside a white box. This guide explains what each common format stores, where it is actually supported, and how to convert between them without losing something you needed.
What each format actually stores
A format is a set of decisions about what to keep. The table summarises the ones that matter.
| Format | Compression | Transparency | Animation | Colour depth | Metadata |
|---|---|---|---|---|---|
| PNG | Lossless | Full 8- or 16-bit alpha, or palette and colour-key transparency | Yes (APNG, now part of the PNG specification) | 1 to 16 bits per channel | Text chunks, ICC profile, EXIF |
| JPEG | Lossy | None | None | 8 bits per channel | EXIF, XMP, ICC profile |
| GIF | Lossless, 256 colours per frame | Binary (one palette entry) | Yes | 8-bit palette | Comment and application extensions |
| WebP | Lossy or lossless | Full alpha in both modes | Yes | 8 bits per channel | EXIF, XMP, ICC profile |
| AVIF | Lossy or lossless | Full alpha | Yes (image sequences) | 8, 10 or 12 bits per channel | EXIF, XMP, ICC profile |
| SVG | Vector description, usually served gzipped | Inherent – no background unless you draw one | Via CSS, SMIL or script | Not applicable | Title, description, any XML |
PNG stores every pixel exactly: it predicts each row from its neighbours, then compresses the result with DEFLATE, the algorithm behind ZIP. There is no quality slider; “compressing a PNG” means finding a tighter encoding or reducing the colours to a palette, a trade-off covered in the compression guide. Every browser, email client, office suite and operating system has handled PNG for decades.
JPEG was designed for photographs. It usually stores colour at reduced resolution, splits the picture into 8×8 blocks and rounds away fine detail in each block according to the quality setting. It has no alpha channel and every re-save discards a little more. Support is universal.
GIF limits each frame to 256 colours and offers only on-or-off transparency. It survives because of animation, and even there animated WebP, APNG or a muted video element almost always gives a smaller, better-looking result.
WebP has two unrelated modes under one name: lossy WebP, built on the VP8 video codec, competes with JPEG; lossless WebP competes with PNG. Both support an alpha channel and animation. Google, which developed the format, states that lossless WebP is typically around 26 % smaller than PNG and lossy WebP 25–34 % smaller than JPEG at equivalent SSIM quality; the real figure depends on the image, so compare the output rather than assuming the saving. WebP has a maximum size of 16,383 pixels on each side, which rarely matters on the web but does for large scans and panoramas.
AVIF packages a still frame from the AV1 video codec. It usually beats WebP on file size, particularly at low quality where it degrades into softness rather than blocks, and it supports 10- and 12-bit colour, high dynamic range and wide colour gamuts that the older web formats cannot represent. The costs are slower encoding and younger support outside browsers.
SVG is not a bitmap at all. It is an XML document describing shapes, paths, text, gradients and filters, drawn by the browser at whatever size is needed. It can be styled with CSS and, because it may contain scripts, should be sanitised before you accept it from strangers (an SVG loaded through an <img> element cannot run scripts; one inlined into the page can). Text renders with whatever fonts are available unless converted to outlines.
Browser and application support in practice
Browser support is the easy part. WebP has been supported in every current browser since Safari 14 shipped in 2020. AVIF has been supported in Chrome and Firefox for several years, in Safari since version 16 and in Edge since early 2024, so for current browsers it is safe; the caveat is older installations, which is why AVIF is usually offered as the first option in a <picture> element with a WebP or JPEG fallback. SVG has been universal for well over a decade.
The rest of the pipeline is less tidy. Email clients, desktop applications, content management systems and social platforms each have their own decoders, and some still reject WebP or silently re-encode anything they do not recognise. A format that is perfect for a page you control may be wrong for a file you send to someone else. The rule of thumb:
- For images on your own site, WebP is a safe default, with AVIF as an optional first choice and JPEG or PNG as the fallback.
- For files handed to other people or systems – email, ad networks, print, documents – JPEG and PNG remain the lowest-risk choices.
- For logos, icons and diagrams you control, SVG, with a PNG rendered from it for the places that need a bitmap.
The format inspector shows what a file really is, as opposed to what its extension claims; mislabelled files are common.
A decision table by content type
The content of the image, not the format it arrived in, should drive the choice.
| Content | First choice | Fallback | Avoid |
|---|---|---|---|
| Photographs and realistic renders | Lossy WebP (or AVIF with fallback) | JPEG at quality 75–85 | PNG – several times larger for no visible gain |
| Screenshots, UI mock-ups, charts | Palette PNG or lossless WebP | PNG as exported | JPEG – smears text and sharp edges |
| Logos, icons, line illustrations | SVG | PNG at 2× display size | JPEG – no transparency, soft edges |
| Photos with transparent or soft-edged cut-outs | WebP with alpha | 32-bit PNG | JPEG and GIF – no usable alpha |
| Short animations | Muted video (MP4 or WebM) | Animated WebP or APNG | GIF beyond a few frames |
| Images that will be edited again later | The original (RAW, layered or lossless export) | 16-bit PNG | Any re-saved JPEG |
If an image mixes categories – a product photo on a transparent background, say – choose for the part that would suffer most; here lossy WebP with alpha serves both.
Conversion pitfalls
Converting changes the container, never the information already lost. Several conversions look harmless and are not.
JPG to PNG cannot recover quality
A JPEG has already had detail removed. Saving it as PNG stores the artefacts faithfully in a lossless file several times larger. The conversion is legitimate when a system demands PNG or you need to add transparency to a photo, but the image will not look better. Use JPG to PNG for compatibility, not quality.
PNG to JPG flattens transparency
JPEG has no alpha channel, so every transparent pixel must become some colour. If the converter does not let you choose, it will probably pick white, which is why so many logos appear on the web inside a white rectangle. Decide what the image will sit on and set that as the background; the PNG to JPG converter lets you choose the colour and warns before flattening. The transparency guide covers the edge halos that come with this.
Lossy to lossless and back again
A lossy file converted to a lossless format and back to a lossy one has been through two lossy encodes, each rounding the detail that survived the last, so quality drifts downwards with every round trip even at generous settings. When switching between lossy formats – say JPEG to WebP – go directly from the best original you have, and keep it.
SVG to PNG fixes a size
Rasterising an SVG freezes it at one pixel size. Render at the largest size the bitmap will be displayed, doubled for high-density screens; a 24-pixel icon rendered at 24 pixels looks soft on almost every modern phone. The SVG to PNG tool lets you set the output dimensions explicitly.
WebP to JPG or PNG
Converting WebP back to an older format is often needed for applications that cannot open it. WebP to PNG is lossless and safe, though a lossy WebP produces a large PNG that still carries its artefacts. WebP to JPG discards any alpha channel and adds a second lossy generation, so pick the quality carefully and flatten against a sensible background.
Metadata and EXIF orientation
Cameras and phones write EXIF metadata into their files: exposure settings, timestamps, often GPS coordinates, a thumbnail and a colour profile. Two items matter when you convert.
The first is the orientation tag. Many cameras store the sensor data as captured and record a number from 1 to 8 saying how the image should be rotated or flipped for display. Browsers and operating systems honour that tag by default, so a portrait photo looks right even though its stored pixels are landscape. A converter can rotate the pixels and drop the tag (“baking in” the orientation), copy the tag into a format that supports it, or strip the tag without rotating – which produces a photo lying on its side. PNG has an EXIF chunk, but tool support is inconsistent, so baking in the rotation is the safer behaviour. Always glance at the orientation of converted phone photos.
The second is the colour profile. Recent phones often save photos in Display P3, a wider gamut than sRGB. If a converter strips the profile without converting the colours to sRGB first, browsers assume sRGB and the image looks slightly duller. Good converters either keep the profile or convert to sRGB and then strip it.
Stripping metadata is otherwise a sensible default for the web: it shrinks files and removes GPS positions you did not intend to publish. The format inspector reports whether a file carries EXIF, ICC or XMP data and what its orientation tag says, which is a quick check before and after conversion.
A quick workflow
- Identify the content: photo-like, graphic-like, vector, or animated.
- Pick the format from the decision table, keeping in mind who or what will consume the file.
- Convert from the best original you have, not from an earlier lossy export.
- For transparent images going to JPEG, choose the background colour deliberately; for SVG going to PNG, set the output size for the largest display, doubled for high-density screens.
- Check orientation and colour after converting phone photos, then strip the remaining metadata.
- Resize to the display size and compress as the final steps – see the guides on image sizes and optimising for the web.
Try it: PNG to JPG for photos saved as PNG, JPG to WebP for web pages, or SVG to PNG when a vector needs a fixed size.
The converters on this site run entirely in your browser, so the original never leaves your device. Each applies EXIF orientation to the pixels before converting, and warns before transparency is flattened rather than doing it silently.
Sources and further reading
- W3C – Portable Network Graphics (PNG) Specification (Third Edition)
- Google Developers – An image format for the Web (WebP)
- Google Developers – WebP Frequently Asked Questions
- Alliance for Open Media – AV1 Image File Format (AVIF) specification
- MDN – Image file type and format guide
- MDN – CSS image-orientation
About the author
HelpMeJPG editorial teamEditorial team
The people who build and maintain the HelpMeJPG tools. Guides are written from the tools' own behaviour and the standards they implement, and are revised whenever a tool changes.