Blabla/Inputs

ENG) Lossless, Lossy Image Compression

ej503 2022. 6. 13. 09:00

In a blog post last year, I took a look at lossy image formats and how they stack up. This time, I thought it might be interesting to do a comparison of lossless image formats.

Lossless compression is a way to make a file smaller so it’s faster to transfer or download, but it can be decompressed back to the exact same original file.

 In a web context, GZIP compression is often used to make JavaScript and CSS files smaller.  In image compression, PNG is a well-known lossless format. JPEG is probably the most well-known lossy image format. Since large photos would otherwise be too big to transfer and store, losing some quality is often a good tradeoff.

Lossless compression is great for images with large continuous areas of color since they will compress well using lossless compression algorithms. You can think of the classic Run-Length Encoding (RLE) algorithm which compresses repetitive data very efficiently. The real algorithms these formats use are of course more complicated.

Therefore, lossless image compression works best for things like logos, screenshots, charts, and graphics. Compressing these kinds of images with lossless compression can often lead to smaller file sizes with better quality when compared to lossy compression.