This method can be combined with dithering to avoid posterization. Each pixel just references the index of a color in the color palette. The selected colors are specified in the colour palette in the header of the compressed image.
Color quantization - Reducing the color space to a few "representative" colors in the image.The more recently developed wavelet transform is also used extensively, followed by quantization and entropy coding.DCT is used in JPEG, the most popular lossy format, and the more recent HEIF.It is generally the most efficient form of image compression. The DCT is sometimes referred to as "DCT-II" in the context of a family of discrete cosine transforms (see discrete cosine transform). It is a type of Fourier-related transform, and was originally developed by Nasir Ahmed, T.
Lossy compression methods, especially when used at low bit rates, introduce compression artifacts. Lossless compression is preferred for archival purposes and often for medical imaging, technical drawings, clip art, or comics. Image compression may be lossy or lossless.