Image compression reduces file size by removing redundant or less-noticeable data. Two main approaches exist:

  • Lossless: keeps every pixel but packs data more efficiently. PNG and WebP lossless are examples.
  • Lossy: discards detail your eye is less likely to notice. JPG and WebP lossy use quality levels to balance size and fidelity.

Good compressors adjust chroma subsampling, optimize Huffman tables, and strip metadata. Aim for the smallest file that still looks clean at your target resolution and device sizes.