Image compression aims to reduce the amount of information in a graphic or photograph while retaining the information content. Image compression includes lossy compression, which takes advantage of limited human perceptual capabilities, and lossless compression, which allows the information content to be reproduced in full detail.
Lossless image compression
A simple method for lossless image compression is based on storing the differences between two pixels. Based on the RGB color model, each of the three primary colors is treated individually and the difference between two neighboring color pixels is stored.
Lossy image compression
Lossy image compression relies on quantization techniques where, in the simplest case, the quantized signal is stored at a lower resolution. The simplest method is that of scalar quantization (SQ), which means nothing other than the rounding of the individual values. This is done, for example, by storing samples that have a sample depth of 16 bits with only 10 bits.
Image compression methods make use of human perception with its limitations. For example, the perception of small deviations in brightness is relatively high in uniform areas, but low in small details. Based on these findings, images and image details are converted accordingly. Some values contain only the details, others the large areas. Both values can then be encoded with lower resolution. For color images, the brightness and color information are compressed separately. In this process, the colors that the eye resolves lower than the brightness are sampled at a lower sampling depth in color subsampling.
The best known lossy compression for graphics and photos is JPEG. In addition to lossy and lossless image compression, there is also fractal image compression. This is based on iterative function systems( IFS). This means that a fixed target image is obtained by repeating certain transformations. The example with the Sierpinski triangle illustrates fractal image compression, in which triangles are replaced by smaller and smaller triangles rotated in the axis.