Format conversion is mostly a question of what the file is for. Get that right and the conversion itself is one command.
Pick the destination first
| Format | Use it for | Watch out |
|---|---|---|
| JPEG | Photographs, universal compatibility | No transparency; every save loses a little |
| PNG | Screenshots, logos, anything with transparency or sharp edges | Enormous for photographs |
| WebP | Almost everything on the web | Some desktop software still cannot open it |
| AVIF | Photos where size matters most | Support is broad, not universal; slow to encode |
| HEIC | What your iPhone produced | Barely readable outside Apple |
| SVG | Logos and icons that must scale | Vector only — a photo cannot become one |
| TIFF | Print and archival | Very large |
Two rules cover most mistakes. Photographs do not belong in PNG — it is lossless, so it stores JPEG artefacts as though they were detail and the file balloons. Screenshots of text do not belong in JPEG — lossy compression smears the edges of letters into grey mush.
For one file, or a folder of the same kind of file, a command is faster than any interface. macOS, no install:
sips -s format jpeg photo.heic --out photo.jpg
ImageMagick, anywhere — the format is inferred from the extension:
magick photo.png photo.webp
The conversions people actually need
HEIC to JPEG
The most common one. iPhones shoot HEIC by default and much of the world cannot open it.
sips -s format jpeg IMG_0001.heic --out IMG_0001.jpg
On Windows or Linux, HEIC support depends on codecs that may not be installed — this is the case where a browser tool that carries its own decoder is genuinely less trouble than fixing the system.
Anything to WebP
The single best change for images on a website:
magick photo.jpg -quality 82 photo.webp
Quality 82 is a good default; WebP holds up better at a given quality number than JPEG does.
PNG to JPEG, and the transparency trap
JPEG has no alpha channel. Converting a transparent PNG to JPEG replaces the transparent areas with something — often black — and the result looks broken. Flatten onto a known background first:
magick logo.png -background white -flatten logo.jpg
Quality, and when it does not apply
Lossy formats (JPEG, WebP, AVIF) take a quality number. Lossless ones (PNG, TIFF, BMP) ignore it — there is no trade-off to make.
- 90–100 — archival. Large files, no visible benefit over 85 for most images
- 80–90 — the working range for anything published
- 60–80 — thumbnails and previews
- Below 60 — visible blocking on any photograph
JPEG to WebP decodes the JPEG and re-compresses it, so the new file carries the old damage plus a little more. It is usually worth it for the size saving, but convert from the original whenever you still have it.
- Work on a copy. Format conversion is not reversible in any useful sense.
- Check the batch is actually uniform — one PNG logo hiding among photographs will come out wrong if you apply photo settings to everything.
- Convert, then spot-check the most detailed image and anything with transparency.
- Keep the originals until you are sure.
Why do this in a browser at all
Three honest reasons, and none of them is "it is better than ImageMagick":
- The format is exotic. PSD, XCF, JXL, camera RAW. Installing a toolchain for one file you were sent is disproportionate.
- The images are private. An upload-based converter puts them on a server. This one decodes and re-encodes in the tab.
- You want to see what you are getting. A batch of mixed images benefits from eyes on each result, which a command line does not give you.