Skip to content
All writing Part 02 of 07 · Crop, Resize, Fill: Image Processing
Engineering · 1 min read

Image Format Cheat Sheet

A one-table cheat sheet of seven image formats — JPEG, PNG, GIF, WebP, AVIF, SVG, TIFF — comparing compression, alpha, animation, and color to pick fast.

Every time I pick an output format, I end up re-checking whether it supports transparency or can animate. So I compressed it into one table:

FormatCompressionAlphaAnimationColorBest for
JPEG (.jpg/.jpeg)lossyfull RGBphotos: smooth gradients, no transparency
PNG (.png)lossless✗ (APNG rare)full / palettegraphics, logos, screenshots, transparency
GIF (.gif)lossless, ≤256 colors1-bit onlypalettesimple short animations (legacy)
WebP (.webp)lossy or losslessfullweb all-rounder: covers JPEG, PNG, and GIF
AVIF (.avif)lossy or losslessfull + HDRbest compression, slower to encode
SVG (.svg)vector (text)✓ (CSS/JS)anyicons, logos, line art: scales infinitely
TIFF (.tif)lossless, multipagemulti-pagefull + 16-bitprint and archival, very large

Rules of thumb for picking:

  • Photo → JPEG (or WebP/AVIF for smaller size).
  • Transparency, or sharp graphics and text → PNG (or lossless WebP).
  • Needs to animate → WebP/AVIF; use GIF only if a legacy target forces it.
  • A logo or icon that must scale cleanly → SVG.

The extension sets the capability boundary (alpha, animation), not the file size.


References:

Related: Pair this with lossy vs lossless drives file size and ad serving flips the format priority — or go back to the crop, resize, fill overview.

Tags #image-processing #file-formats
// connect

Be brave | Be wise | Be grateful

21 BreakinCode

// elsewhere
LinkedInMedium (lang: en)Life RecordYoutube
wh:~$William Hung· © 2026 Taipei · GMT+8 · Available for collaboration