Compression of color design and its coordination

Most color image acquisition devices and image processing software use 24-bit true color image data structures to record image information, ie, record colors in red (R), green (G), and blue (B) color modes. In the data structure, R, G, and B are each represented by one byte. R, G, and B each have 256 levels and can represent 16.77 million colors.
Direct display and transmission of this color digital image requires a 24-bit color hardware structure and occupies a large amount of storage space. It can cause problems such as large amount of data and slow operation speed for some applications. In particular, in the absence or inability to use a 24-bit color display environment, displaying 24-bit color images can cause serious color distortion if left untreated.
More and more GUI applications require clean and clear bitmap icons. Bitmap icons are often represented by 256 colors. To this end, we envisage the use of human eyes for the limited ability of color resolution, using a byte-wide 8-bit data structure to display, store, or transfer 24-bit true-color images, ie to create 256 colors or less of color information as an index Values, to simulate 16.77 million colors, to achieve color compression of color images, which requires the establishment of an appropriate palette, the conversion of color data expression of the image, that is, with the appropriate number (usually 256 kinds of colors) Index values ​​to fill in the palette.
In general, choosing a suitable palette is not an easy task. In order to use 256 index colors to display a large amount of color information in a 24-bit true color image, a fundamental problem to be solved is to use human eyes to limit the ability of color resolution to replace similar colors with one color. So that the total number of colors is compressed.
Although the human eye has limited resolution of colors, choosing 256 or less colors from 16.77 million colors as an alternative to the color of a richly colored image is still a very difficult task.
There are several algorithms for compressing the total number of color images. Mainly can be divided into the following three categories, one is based on the color distribution of the image to determine the palette; one is to set the palette in advance, according to a certain algorithm to match the color of the image and the palette, ie Another kind of fixed palette method is to use dithering algorithm to achieve image color compression.
According to the color distribution of the image, the method of adapting to set the palette refers to: When expressing the image, the used palette is determined according to the color distribution of the image. Then each image with a different color distribution will have its own different palette. The palette will be calculated in real time based on the color distribution of the specific image.
The commonly used methods for adaptively obtaining a palette are: a color statistics algorithm and a median segmentation algorithm.
The color statistics algorithm first performs a statistical analysis on all the colors in a 24-bit color image, thereby obtaining a color histogram. When we want to express a 24-bit true color image as an 8-bit data structure to record color image information, we only need to create a 256-color index table as a palette. Take the statistical results in the first 256 colors as the color of the original image, and set the 256 colors as the colors in the palette. The remaining colors in the original image are adaptively mapped onto the palette using the principle of minimum distance, ie, mapped to a selected color that is closest to it.
Statistical algorithms can produce better results for images with fewer colors. However, this algorithm has certain drawbacks. For example, if there are high-luminosity spots in the image, this information may be lost in the color combining quantification result. This is because high-brightness areas tend to cover only a few pixels, and their colors are probably not selected by the algorithm.
To avoid this situation, when implementing a color statistics algorithm, eight corners (white, red, green, blue, yellow, blue, green, black, and black) of the color model can be forced to be selected as reserved colors and recorded as a color tone. The content of the first 8 units of the board, because most of the high brightness points are white. This will reduce the bad results that the algorithm may produce.
Color statistics algorithm is an important algorithm. It can produce better results for images with a small total number of color image colors. However, this algorithm still has a big drawback. Although we have selected 8 solid colors as the palette reserved colors, some of the more important colors may not be selected by the palette due to the small number of covered pixels. Some important color information is lost during color mode conversion.
There is an algorithm in the method of setting the color palette according to the color distribution of the image: a median segmentation algorithm.
The basic idea of ​​the median segmentation is to use the RGB model to represent the color space of the image. Each axis of the color cube corresponds to one of the three primary colors of R, G, and B. Each axis is quantized to 0-255,0 which corresponds to the minimum brightness and 255 to the maximum brightness.
In this way, any color in the image can be represented by a point in the RGB color cube. For example, black corresponds to (0, 0, 0), and white corresponds to (255, 255, 255). The cube is cut into 256 small cubes, each containing the same pixels. Using this method to divide the color space, a point is calculated in each small cube as the representative value of all colors of the cube, thereby compressing the color to 256 values.

Pet Food & Treats

Ningbo XISXI E-commerce Co., Ltd , https://www.petspetskitty.com

Posted on