Skip to content

Image codecs overview

current

Pick a format by what the image is and where it has to be displayed. This page gives the short answer; each format page covers encoders, settings and pitfalls.

You have…UseWhy
Photos for the webAVIF or WebP, with a JPEG fallbackAVIF compresses best and has wide browser support; WebP encodes faster and is supported everywhere current; JPEG opens on anything
Photos where quality matters most, or HDR and wide gamutJPEG XLExcellent at high quality, supports HDR, lossless and progressive decoding. Supported in Safari 17+ and Chrome 155+; Firefox 158 (due 13 October 2026) enables it
Existing JPEGs you want smallerJPEG XL lossless transcode, or jpegtran / MozJPEGJPEG XL keeps the original JPEG recoverable bit for bit
Screenshots, UI, logos, line artPNG (optimised with oxipng), or lossless WebPLossless and sharp; pngquant makes a lossy palette version much smaller
TransparencyPNG, WebP, AVIF or JPEG XLJPEG and GIF can’t do soft alpha
Lossless masters and archivesPNG or TIFF; JPEG XL lossless for smaller files; JPEG 2000 in institutions that already use itKeep a lossless master and export delivery files from it
AnimationA looping muted video, animated WebP or AVIF; GIF only where nothing else worksGIF is the largest and has 256 colours; see the GIF page
Phone and Apple-camera filesHEICCommon camera output, but convert before sharing: licensing and support are patchy
Fast lossless in a game or toolQOITrivial to implement and very fast, but larger files and no browser support
FormatCompressionBit depthAlphaAnimationBrowser support (October 2026)
JPEGLossy8NoNoEverywhere
PNGLosslessUp to 16YesAPNGEverywhere
GIFLossless, 256 colours8 (palette)1-bitYesEverywhere
WebPLossy or lossless8YesYesAll current browsers
AVIFLossy or lossless8, 10, 12YesYesAll current browsers
JPEG XLLossy or losslessUp to 32YesYesSafari 17+ (stills only), Chrome 155+, Firefox 158+
HEICLossy or lossless (HEVC)8, 10 and upYes (auxiliary)Image sequencesSafari 17+ only
JPEG 2000Lossy or lossless1–38 in the standard (tools mostly handle ≤16)Yes (JP2 channels)MJ2 onlyNone (Safari dropped it in 18.0)
QOILossless8YesNoNone

Browser support changes quickly; the image and audio support guide is kept up to date, and the guide to the option tables lists every command-line option for the tools on these pages.

  • Always encode from a lossless master. Re-encoding a lossy file stacks errors.
  • Compare by eye. For automatic comparison across formats use SSIMULACRA2 or Butteraugli; PSNR and SSIM reward blur and mislead on perceptually tuned encoders.
  • Check metadata and colour. Orientation, ICC profiles and HDR signalling are the first things converters drop. Test one image from your pipeline in each target viewer.
  • Quality numbers are per encoder. -q 80 in cjpeg, cwebp, avifenc and cjxl gives four different quality levels; compare outputs, not settings.