image formats intro: jpeg png gif webp

By Xah Lee. Date: .

most important things to know about image formats

lossy vs lossless

formatlossy?
PNGlossless
JPEGlossy
WebPlossy or lossless
GIFlossless

Lossy means each time you save the image, the quality degrades. Including, rotate, crop, resave, or any edit, or converting from another image.

lossy image compression was created because it can make file size by 10 times smaller yet with littel perceived visual quality loss, by exploiting human perception.

number colors

formatnumber colors
PNG8 bits per channel
JPEG8 bits per channel
WebP8 bits per channel
GIF256 total

If the destination format do not support some features, such as colors, it'll be lost. E.g. Converting from png to gif.

new image formats, such as HEIC, AVIF, JPEG XL, supports more than 8 bits per color channel, for wide color gamut.

animation

formatanimation
PNGno
JPEGno
WebPyes
GIFyes

image processing