Compression JPEG
JPEG compression is a widely used method for reducing the file size of digital images, particularly photographs. The term ‘JPEG’ stands for Joint Photographic Experts Group, the name of the committee that created the standard.
The primary technique used in JPEG compression is called lossy compression. This means that some image data is discarded to achieve smaller file sizes. The compression process works by analyzing the image and removing details that are less noticeable to the human eye, such as slight color variations and fine textures. This allows for significant reductions in file size, often by 10:1 or more, without a substantial loss of quality in many cases.
La compression JPEG implique plusieurs étapes clés :
- Transformation de l'espace colorimétrique : The image is converted from RGB color space (red, green, blue) to YCbCr, which separates brightness (luminance) from color (chrominance).
- Sous-échantillonnage : The chrominance data may be downsampled because the human eye is less sensitive to color details than brightness details.
- Transformée Cosinus Discrète (DCT) : The image is divided into small blocks (typically 8×8 pixels), and a mathematical transformation is applied to convert spatial data into frequency data.
- Quantification: The frequency data is quantized, which involves reducing the precision des fréquences moins importantes pour atteindre la compression.
- Encodage : The quantized values are then encoded using techniques such as Huffman coding pour réduire encore la taille du fichier.
While JPEG is excellent for photographs and images with gradients, it is not ideal for images with sharp edges or text, as the lossy compression can create artifacts. For applications requiring higher fidelity, lossless formats d'image like PNG may be preferred. Overall, JPEG compression balances quality and file size, making it a popular choice for web and digital photography.