Lossless compression reduces file size by encoding data more efficiently, without removing any information. Decompressing a losslessly compressed file produces a bit-for-bit identical copy of the original. Lossless algorithms include DEFLATE (used in PNG and ZIP), LZW (used in GIF and old TIFF), and LZ4/ZSTD (modern lossless codecs).
For images, lossless compression works by finding redundancy: repeating patterns, runs of identical pixels, and predictable gradients are all represented more compactly than raw pixel data. Images with large areas of flat color (logos, screenshots, UI elements) compress well losslessly. Complex photographs with continuous color variation compress poorly losslessly — use lossy compression (JPEG) instead.
Lossless compression formats: PNG (images), WebP lossless (images), FLAC (audio), ALAC (Apple lossless audio), ZIP/GZIP (general files). When lossless quality is required — archiving originals, graphics with sharp edges, images that will be edited further — always choose lossless. For distribution and sharing where smaller file size matters more, lossy compression at high quality is usually the right choice.