Research on Color Compression of Color Images

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 such color digital images 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, displaying 24-bit color images without or with a 24-bit color display environment can cause serious color distortion if left untreated. At the same time, 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, use a byte-wide 8-bit data structure to display, store or transfer 24-bit true-color images, that is, to create 256 colors or less 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 value to fill in the palette.
In general, choosing a suitable palette is not an easy task. In order to display a large amount of color information in a 24-bit true color image with 256 index colors, a fundamental problem to be solved is to use the human eye 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. Can mainly 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. 1. Self-adaptively determining the color palette according to the color distribution of the image The method of adaptively setting the color palette according to the color distribution of the image means that when the image is expressed, 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 flaws. For example, if there are high-brightness spots in the image, this information may be lost in the color-merged quantization results. 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 because there are fewer pixels covered. 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 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 segment 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. Second, the fixed palette algorithm Fixed palette algorithm refers to the method of pre-setting the palette before image processing.
There are many ways to set the palette in advance, which can be accomplished based on the specific application and prior knowledge. Studies have shown that the human eye has the strongest ability to distinguish green tones, and weaker to blue tones. Therefore, it is also possible to use human visual characteristics to set adjuster swatches. For example, the red area of ​​the color cube is divided into 6 levels, the green area is divided into 7 levels, and the blue area is divided into 6 levels.
The biggest feature of the fixed palette algorithm is that the palette selection is not based on the color distribution of the image, but the palette is set in advance. In the color statistics algorithm, the information of the color image is obtained by calculation, but these operations are not available in the fixed palette algorithm. Doing so can greatly improve the color compression efficiency of the image.
This algorithm also has a big drawback. If the colors contained in an image are close, the result obtained by this algorithm will be unsatisfactory. For example, an image shows a field, the field has grass green, greenish green, dark green, light green, etc., but by using a fixed palette algorithm for color compression, these 4 different greens will be possible. Expressed by the same kind of green, this result is lost when the image is green, and this result loses the difference in the color of the image. The display is unsatisfactory. Therefore, the fixed palette algorithm is not suitable for images with color distribution features. 3. Dithering Algorithm Another very useful method of displaying images rich in color information using a device that can display only a few colors is dithering. In recent years, dithering technology has received more extensive attention. It can better solve the problems of color compression and color distortion after compression. Here we introduce two kinds of dithering methods that display images better on the screen: Bayer jitter and WING jitter. 1. Bayer jitter is one of the ordered jitter methods. The basic principles of ordered jitter are as follows: Let V be the output pixel value, C be the input pixel value, and d(x, v) be the mxm matrix, then the jitter process can be used. The expression 1 C(x,y)>d (x,y)V(x,y)={0 C(x,y) ≤d(x,y) where d(x,y) is called a dither matrix d(x,y)=M[y mod m][x mod m] The following matrix is ​​a form of a dither matrix. This dithering method is called Bayer dithering. 0 32 8 40 2 34 10 4248 16 56 24 50 18 58 2612 44 4 36 14 46 6 3860 28 52 20 62 30 54 223 35 11 43 1 33 9 4151 19 59 27 49 17 57 2515 47 7 39 13 45 5 3763 31 55 23 61 29 53 212. WinG Jitter WinG is an optimized high-performance graphics library designed for Windows 3.1, Windows 95, and Windows NT and runs on 386+ processors. Programmers can directly copy in-memory device-independent bitmaps to the screen and provide a dithering API that uses the standard Microsoft Dither palette to support true-color emulation.
The Jitter Palette is a peer-to-peer palette that contains colors that are carefully selected and optimized to simulate true color by dithering on 8-bit devices. The WinG Graphics Library provides two APIs that support jitter: WinG Create Halftone Palette WinG Create Halftone Brush for simulation.
The dither palette provides a framework for applications to 24-bit image jitter to 8-bit devices. The 256-color dithering palette contains 20 static colors and a series of grayscale values.
Given a 24-bit RGB color, the closest color index value in the dither palette can be calculated as follows: HalftoneIndex=(Red/51)+(Green/51)×6+(Blue/51)×36; HalftoneColorIndex=aWinGHalftoneTranslation[HalftoneIndex]; The AwinGhalftoneTranslation vector can be found in the HALTONE source.
By analyzing and experimenting with 24-bit color to 8-bit color algorithms, we can see whether statistical algorithms, median segmentation algorithms, fixed palette algorithms, or dithering algorithms all have their advantages and disadvantages. When faced with an image that requires a color display mode conversion, we should treat it differently and choose a suitable algorithm from these algorithms in order to achieve better results.
In general, the dithering algorithm works well. In recent years, the dithering algorithm has received a great deal of attention. In some game software, almost all dithering algorithms are used to convert 24-bit images into 8-bit color images. Through conversion, the cost of storage is reduced, the display efficiency is greatly improved, and some of the original can only be run under DOS. The game was ported to WINDOWS. This greatly improves the quality of the game. For statistical algorithms, it is suitable for use in images with a small number of colors, but not for images with a large number of colors. For a large number of color images, a fixed palette algorithm can be used.
In short, in the image compression and conversion of an image, various factors, such as the color distribution and the operating speed of the conversion process, must be taken into account in order to obtain the best results. 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 such color digital images 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, displaying 24-bit color images without or with a 24-bit color display environment can cause serious color distortion if left untreated. At the same time, 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, use a byte-wide 8-bit data structure to display, store or transfer 24-bit true-color images, that is, to create 256 colors or less 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 value to fill in the palette.
In general, choosing a suitable palette is not an easy task. In order to display a large amount of color information in a 24-bit true color image with 256 index colors, a fundamental problem to be solved is to use the human eye 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. Can mainly 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

Silicone Teether

Silicone Teether,Silicone Teething Rings,Silicone Fruit Teether,Silicone Bead Teether

MeMe Baby Product (GZ) LLC , https://www.gzkupbo.com

Posted on