What's the best image format for the web (and how to export it on Mac)?
JPEG, PNG, WebP, AVIF, SVG — they each have a job. Here's how to pick the right one for the web and export it from your Mac.
You’re building or maintaining a website and your images are too big, too slow, or just look wrong. Picking the right format is half the battle — the other half is exporting it efficiently. Here’s the practical version: which format for which job, and how to make it on macOS.
The shortlist
- JPEG — photos, broadest compatibility.
- PNG — graphics, logos, screenshots, anything needing transparency or sharp edges.
- WebP — modern photos and graphics, ~30% smaller than JPEG/PNG.
- AVIF — even smaller than WebP for photos, browser-only.
- SVG — icons, logos, anything that needs to scale infinitely.
When to pick each
JPEG if you need universal compatibility or the destination is older. Quality 75–85 for web, 90+ for hero images.
PNG for screenshots, UI elements, illustrations with sharp edges, or anything with transparency. Don’t use PNG for photos — it’ll be 5× the size of an equivalent JPEG.
WebP for almost any photo on a modern site. Universal browser support (Chrome, Safari 14+, Firefox, Edge). Roughly 30% smaller than JPEG at the same quality.
AVIF for image-heavy sites where you control the CDN and serve modern formats. Around 50% smaller than JPEG. Still less broadly supported in tools outside browsers.
SVG for logos, icons, and diagrams. Tiny files, infinitely scalable, stylable with CSS. Not for photos.
The picture element pattern
Best practice for performance is <picture> with format fallback:
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img src="hero.jpg" alt="...">
</picture>
Browsers grab the first format they support. You serve AVIF to capable browsers, WebP to most, JPEG to the rest.
Exporting on Mac — native
sips handles JPEG, PNG, HEIC, TIFF, and (on Sonoma+) WebP. For AVIF you’ll need ImageMagick:
brew install imagemagick
# JPEG
sips -s format jpeg -s formatOptions 85 photo.png --out photo.jpg
# PNG
sips -s format png photo.jpg --out photo.png
# WebP
sips -s format webp -s formatOptions 80 photo.jpg --out photo.webp
# AVIF
magick photo.jpg -quality 60 photo.avif
The faster way
Drag your masters into Melt, output to WebP (or JPEG), set quality, optionally resize. Run the same source through twice — once for WebP, once for JPEG fallback — and you’ve got everything for a <picture> element. Download Melt.
Web export in Melt
- Open Melt.
- Drag your image masters in.
- Set output to WebP, quality 80.
- Resize to your max display width (1600–2400 px is typical for hero images).
- Confirm "Strip metadata" is on.
- Click Compress.
- Repeat with output set to JPEG for fallback.
What you lose, what you keep
Lossy web formats (JPEG, WebP, AVIF) discard data. At sensible quality settings (JPEG 85, WebP 80, AVIF 60) the loss is invisible to viewers and the file-size savings are real. Stripped EXIF means visitors can’t see when or where the photo was taken — usually what you want for a public site. Keep your high-resolution masters somewhere separate; the web exports are derived files you can regenerate any time.
More Melt tips
-
Receive iPhone photos as JPG via AirDrop (not HEIC)
AirDropping photos from iPhone keeps landing them as HEIC files on your Mac. Here's how to get them as JPG instead.
-
AVIF on Mac — opening and converting AVIF images
AVIF is the next-gen image format that's even smaller than WebP. Here's how to open and convert AVIF files on macOS.
-
How to batch compress a folder of photos on Mac
Compressing 200 photos one at a time is its own form of suffering. Here's how to batch compress images on macOS.
-
Convert a BMP to PNG on Mac
BMP files are huge and rarely useful. Here's how to convert them to PNG on macOS — natively and in batches.