# Design and Realization of Animation Composition and Tone Space Conversion Algorithm

Authors: Liang Jing
Journal: Complexity
 (2021)

---

## Abstract

In recent years, with the development of society and the rapid development of the animation industry, people are paying more and more attention to and requirements for animation production. As an indispensable part of animation production, picture composition plays a major role in animation production. It can give full play to the application of color matching and light and shadow design and enhance the depth and space of the animation screen. Tone space conversion refers to the conversion or representation of color data in one color space into corresponding data in another color space. Its purpose is to distinguish and process color components such as hue and saturation in an image. This article first introduces the domestic and foreign research status of digital image preprocessing and analyzes the basic principles of several color space conversions in detail. Then, several color space conversion algorithms are studied, and the performance of the algorithms is compared and analyzed. The paper focuses on the hardware implementation and optimization of the algorithm for converting RGB color space into HSI color space to meet the real-time requirements. This article focuses on the mutual conversion between the RGB tone space and the HSI tone space and describes in detail how each color component in the HSI tone space is converted from the three RGB color components from a geometric perspective, and then the conversion is derived, and several general conversion methods of RGB to HSI tone space are introduced; two conversion methods of geometric derivation method and standard modulus algorithm are implemented in the software, and the comparison verification is carried out, and the comparison is made from the perspective of hardware implementation. The pros and cons of the two methods are discussed. Finally, the paper summarizes the shortcomings in the design and proposes further research directions in the future.


---

## Body

## 1. Introduction

In recent years, with the development of society and the rapid development of the animation industry, people are paying more and more attention to and requirements for animation production [1]. Traditional animation production and composition have been unable to meet people’s requirements for animation in contemporary society, and animation production is facing new tests and requirements. As an indispensable part of animation production, picture composition plays an important role in animation production. It can give full play to the application of color matching and light and shadow design and improve the depth and space of animation pictures. Therefore, how to effectively apply composition in animation production is an important issue that animators need to think about.The name of composition originated from a course in Western painting called composition [2]. With the development of society, composition has become a term of plastic art, and its meaning is to link the images that you want to show in combination with the theme and the requirements of the subject, so as to form a complete and coordinated picture. Composition is not only a creative result, but also a creative act. Animation composition refers to the fact that, in the process of designing the animation, the person who makes the animation combines the director’s requirements and intentions, through thinking and conceiving, rationally organizing and arranging materials such as shots, images, and modeling to produce scenes and actions that can express the intention of the animation [3]. Composition can play the role of color in animation production. Color can render the emotional atmosphere of the development of the animation story. Animation scenes can be rendered through the color tone and can also reflect the tone design of the animation film. Colors can be designed according to different story plots to design the scene, composition, and tone of the film to stimulate the development of the story plot and set the plot needs. Color application needs to be based on the design of the scene or the character. With the basic elements, the shape and structure can be used to design the animation film scene composition. The use of color tone can help designers perfect the lack of composition of the design work, and through color filling and identification, it can help the design to identify errors in the shape and structure [4]. Therefore, color can guide designers to perfect the composition while accurately expressing the emotional needs of animated storytelling. In animation production, the composition is mainly used in the design of subshots. The composition of the animation design can be refined to the scene. The scene design includes color design, composition design, prop design, scene design, character design, lighting design, etc. The most important of these is the composition design. A reasonable composition can accurately express the concept and main idea of the design work and can perfectly reflect the effect of the emotion expressed by the color of the design work. Without a reasonable visual composition, no matter how perfect the color is, it will not reflect its ultimate application value. Color is the most powerful means of animation performance. In the process of making animation, designers can convey the inner emotions of tasks and scenes by changing tones. Different color applications in the composition can show different meanings and give full play to the role of color. In the animation creation, the designer designs the scene composition and light lines required by the animation storyline through the understanding of the animation script and the subshot script. In order to meet the diverse emotional needs of an animated story to create an atmosphere, designers usually use the light in the composition to express the atmosphere of the animation plot [5]. By adjusting the light in the composition, the animation storyline is arranged in an orderly manner, and the story narration can be completed according to the development sequence of the plot. In animation creation, the modeling of characters mainly depends on the light and composition form, so when creating an animated character, the choice of light design and composition form must be considered every time, so as to fully clarify the shaping of the different identities of the animated character. When we need to create warm and romantic scenes, designers mostly use top-down composition and flat light. The designer communicates and adjusts the light in the composition, which can adjust the development rhythm of the animation storyline and play the role of light in the animation. When in the actual animation collection, processing, and display system, because the collected high-speed signals are high-speed real-time image color space conversion, in order to maintain the real-time and completeness of the image, the hardware implementation of the color space conversion is more demanding. Some complex algorithms themselves are very difficult to implement in the language, so we propose tonal space conversion.For this paper, the main contributions are as follows: The color management software based on the software operating system uses the core technology of the computer to provide a color management environment for other application software and uses the operating system to provide a series of functions to realize the color that is transparent to the user and does not require application overhead management. This article briefly summarizes the research background and significance of this topic, briefly introduces the current domestic research on image processing, and analyzes the differences between domestic and foreign research. Subsequently, the concept of color space is introduced in detail, and the conversion algorithm between RGB color space and HSI color space is further introduced based on the concept of color space, and the three color space conversion methods are implemented and compared in the application software. Finally, the simulation environment of software and hardware is introduced, and then the designed algorithm is simulated and verified and comprehensively realized. It points out the shortcomings and improvements in the design of this paper and prospects for further digital image processing work in the future.


## 2. Related Work

Engaged in color management research, experimental research methods are used both at home and abroad. This is because not only is color science a marginal subject, but it is also an emerging subject. Some of the theories are not mature enough and need to be continuously summarized and developed in practice; on the other hand, color theory has ambiguity, which is not only affected by many objective factors, but also affected by subjective psychology [6]. Therefore, color research is a very practical work. From the research content of foreign research organizations and the existing products on the market, the current research status of the color management system is the establishment and continuous improvement of the ICC color management system. The ICC color management system is built on the basis of the large foreign information industry and image industry product systems. It has formed a relatively complete process from the management framework to the specific technical content. For example, some large printing equipment of Heidelberg Company in Germany and digital laser exposure color expansion equipment produced by Fuji Company of Japan all have color management systems (software and hardware) that conform to this system [7]. From the perspective of literature and market demand, the research content is further developed in terms of support in various aspects, increasing the degree of openness, making it easier for users to intervene, and further improving the accuracy of color conversion. Color control is the purpose and core of the color management system, but the control accuracy is affected by various factors such as the adopted color conversion algorithm and application conditions and environment. In practice, the introduction and optimization of these factors can enhance the multilevel research of color control capabilities. For example, the introduction of the color appearance model into the ICC color management standard improves the conversion accuracy; when the software algorithm has a large amount of calculation, how to obtain hardware support to make it practical is also the constant pursuit of research.The status of domestic research can also be summarized in two aspects: (1) a certain degree of basic research has been carried out. In the core technology of color control, that is, color conversion, color gamut mapping, and other content, Zhejiang University, Harbin Institute of Technology, Beijing Institute of Technology, Xidian University, Wuhan University, Tianjin University, and Xi’an University of Technology are committed to the research of color management [8]. This technology is not only used in the construction of common scanning input equipment, printing, and print output equipment color control, but also applied to some more special color control processes, such as the true color digital archiving of items, medical industry with the help of true color analysis, and diagnosis of color collection and display. The research in this area is the foundation for the development of digital color equipment and the construction of a complete color management system, as well as the only way to independent intellectual property rights. It can be said that, from the perspective of the requirements of finished products, domestic research is still in its infancy [9]. (2) A small amount of product technology development research and application research: at present, almost all digital color equipment and color management software and hardware are foreign products, which are expensive. In order to change this situation, Peking University Founder Co., Ltd., developed a color management system for the printing industry, but the core color correction technology still uses foreign modules.There are also institutions in the country that have begun to research and develop wide-format color reproduction equipment suitable for special purposes. In the civil advertising output and color photo expansion industries, some companies have introduced foreign key components to systematically integrate them into finished equipment, which requires built-in color control content and needs to develop independently based on the combination characteristics of the equipment system. In addition, from the National Key Laboratory of Color Science of Beijing Institute of Technology, the Optoelectronics Department of Zhejiang University, the Institute of External Equipment of Xidian University, and the measuring instruments used by major domestic laboratories including our school, although they are not very complete, most of them are imported from abroad [10]; at the same time, large companies that are strongly related to color reproduction are also taken over by foreign countries, such as Heidelberg, Roland in Germany, and Mitsubishi in Japan, all of which are internationally well-known large printing product companies and domestic companies [11]. This not only shows that our country has fallen behind a lot in the research of color science, but also provides clear research tasks for color workers. In short, with the rapid penetration of digital color images in various industries, high-end equipment such as digital proofing and digital printing, as well as non-high-end equipment such as color office, multimedia teaching, and advertising expansion, has shown rapid growth in the domestic market, which promoted the research and development of domestic related product technology. In addition, how to make good use of the existing ICC color management system is also the demand and research direction of the domestic market. For example, in view of the diversity of raw materials such as color materials and paper in the domestic market and the low mechanical repeatability of non-high-end equipment, it is necessary to establish a suitable color conversion algorithm and control method. Applicability issues like this are also being paid attention to by some domestic research and development institutions. From another perspective, color management is mainly divided into operating system-level color management software and application-level color management software. ICC-based operating system-level color management software uses computer core technology to provide a color management environment for other application software and uses the operating system to provide a series of functions, which is transparent to users and does not require application overhead. Color management is implemented independently at the operating system level [12].


### 2.1. Animation Composition and Tone Space Conversion Algorithm

Color is the human eye’s perception of different frequencies of light, so color exists objectively, and on the other hand, color is the human eye’s perception, so color is also subjectively perceivable, and there are differences in perception [13]. Therefore, human beings’ understanding of color has gone through a rather long process, and it was not gradually perfected until modern times. Color space is also known as color gamut. In fact, it refers to the range of various color sets. In color science, many color models have been established to describe a certain color in one-dimensional, two-dimensional, three-dimensional, and even four-dimensional animation space coordinate systems. This coordinate system is defined as a hue space [14].Common hue spaces are RGB, CMYK, HSI, etc. They can be divided into multiple types of hue space standards. For example, RGB tone space can be divided into AdobeRGB, App1eRGB, ColorMatchRGB, etc. These tone space standards are specially formulated based on different hardware devices and are mostly used in their respective display devices and input and output devices. The combination of animation composition and tone space conversion is shown in Figure1.Figure 1
The combination of animation composition and tone space conversion algorithm.


### 2.2. Animation Composition

For grayscale images, the red, green, and blue components of a pixel are equal, but as the values of these components increase, the color of the pixel changes from black to white. The colors in nature can be combined with three colors of red, green, and blue, which are artificially divided into 256 levels, and various colors can be expressed through different combinations of RGB [14]. As can be seen from the above introduction, we can use the RGB tone space to represent a color digital image. Hue space is a mathematical model used to describe color, also known as color model. RGB tone space is the most common one in life, but the tone space used to express color information in image processing is more than this one. Different tone spaces help to analyze a color digital image from different angles. We only focus on the conversion of RGB and HSI tone spaces and then introduce these two tone spaces.According to the principle of chromaticity, the light of various colors in nature is composed of the three colors of red, green, and blue mixed in different proportions. Therefore, the light of various colors in nature can be decomposed into different degrees: red light, green light, and blue light, so we call the three colors of red, green, and blue the three primary colors. The hue space formed with the three primary colors as the coordinate system is called the RGB hue space. As we all know, basically all color imaging devices and color display devices use the three primary colors of red, green, and blue. In addition, the commonly used storage of digital image files is also based on the three primary colors of RGB [15]. In the application of multimedia computer technology, the RGB tone space is widely used. For video, multimedia, and web design, according to the principle of three primary colors, the light of primary colors is used to express the amount of light. The color matching equation of light of any color in the RGB tone space is as follows:(1)light=redR+greenG+blueB.The RGB color animation space is based on the principle of additive color mixing, from black to three colors of red, green, and blue. It can be seen from Figure2 that cyan is synthesized from blue and green, magenta is synthesized from red and blue, yellow is synthesized from green and red, and magenta, yellow, and cyan are exactly CMY (Cyan/Magenta/Yellow) three primary colors [16]. In addition, when the RGB three primary colors are mixed in equal proportions or equal amounts, black, gray, and white can be obtained. The proportions of the three colors of RGB are shown in Figure 2. It can be seen intuitively from Figure 2 that the eight colors of red, green, blue, magenta, yellow, cyan, black, and white are located at the 8 vertices of the cube, and black is usually placed in the three-dimensional coordinates of the RGB hue space. The origin of the system: red, green, and blue are in 3 coordinate systems, respectively, and the whole cube is within the limit of the first hexagram. Among them, red and cyan, green and magenta, and blue and yellow are complementary colors. The value range of each parameter is R 0-255; G 0-255; B 0-255. The parameter values of the three primary colors can also be referred to as the three color coefficients or color values or primary color coefficients, and each parameter value is normalized to obtain a value between 0 and 1. Since each gray level is defined as 28 = 256, different combinations of red, green, and blue components can represent 2563 = 16, 777, 216 colors, but the human eye can distinguish only a few thousand colors, which means the human eye can distinguish the gray scale [16]. There are dozens of levels, so the colors that RGB animation space can represent are much more than the colors that human eyes can distinguish.Figure 2
The structure of the animation space information system.The RGB three-primary color composite map and the RGB hue space coordinate system are shown in Figure2. It can be seen that, under the premise of ensuring the current status and positioning accuracy of the animation space information, the key to achieving the animation space information meeting the requirements of the whole society’s spatiotemporal information service is the accuracy of information expression, and color is the most accurate expression of information. Therefore, the colorization of animation spatial information and its color management are one of the key technologies to meet the needs of users for visualized products of animation spatial information.Due to the infinite complexity of the color expression of animation space information, it is necessary to carry out the complete expression of color digitization in computers with limited capacity and processing power and related equipment, and it is inevitable to associate color abstraction and synthesis problems. Therefore, to objectively express the color of animation spatial information, only through the selection, expression, and quantification of color information can it finally become the content of computer system management and processing, and it is related to these color models and their reproduction systems. In short, color management is a conceptual system involving the expression of animation spatial information. From a methodological point of view, the color management of animation spatial information is facing the problem of finding a reliable theoretical paradigm and model.


### 2.3. Tone Space

When people observe colored objects, they tend to describe them in terms of hue, brightness, and saturation. Figure3 shows RGB and HSI tone space conversion.Figure 3
RGB and HSI tone space conversion.We generally describe it in terms of hue, brightness, and saturation. Hue is the color attribute used to describe a pure color, and saturation is a measure of the degree to which a pure color is diluted by white light. Brightness is a relatively subjective descriptor, which also makes the concept of colorless brightness concretized. Brightness has also become one of the key factors in describing color perception. Hue is a color attribute used to describe a pure color, and saturation is a measure of the degree to which a pure color is diluted by white light. Brightness is a relatively subjective descriptor, which also makes the concept of colorless brightness concretized. Brightness has also become one of the key factors in describing color perception. Brightness, or grayscale, is the most useful descriptor for describing monochrome images. In addition, all points in the plane defined by the brightness axis and the edge of the cube have the same hue. This is because inside the colored triangle, the color is composed of the three vertex colors. The white and black components will only change the brightness and saturation of the point and have no effect on the color change. Rotating this plane with the brightness axis as the axis can get different tones. Therefore, the HSI tone space can be represented by a double cone. From this, the following conclusions can be drawn: the hue, saturation, and brightness values required to form the HSI hue space can all be obtained through the RGB hue space, and any point in the RGB hue space can be found in the HSI hue space.The segmented definition method is to analyze the conversion formula based on the colorimetric definition. From the basic concept of chromaticity, we can know that the tones of the three primary colors RGB are 0, 120, and 240, respectively. When one of the three RGB components is the largest, the component is considered to be the main component, and the hue is within the range of plus or minus 60 near the component. The magnitude of the deviation is normalized by the relative difference between the remaining two components. The HSI tone space model uses three parameters,H, S, I, to describe the characteristics of colors. Among them, H represents the wavelength of the color, also known as hue; S represents the degree of color depth, also known as saturation. In the color cube, assuming we are at the black origin (0, 0, 0), the diagonal direction is exactly the white fixed point (1, 1, 1) as shown in the cube. Associating with the black and white plane, the brightness is distributed along the line between the two vertices, which is the line that gradually changes from black to white. We call the line connecting black and white fixed points the brightness axis; this brightness axis is vertical. This plane and the intersection of the brightness axis are the brightness value of this color point [16]. Since the value of each color component is normalized, the range of this brightness value is between [0, 1]. In addition, you can notice from the figure that saturation is an amount that increases as the distance function from the brightness axis increases. The saturation of a point on the brightness axis is 0. In other words, the points on this axis are all grayscale tones.


### 2.4. Tone Space Conversion Algorithm

Based on the previous discussion about the HSI hue space, it can be seen that the HSI hue space is an animation space formed by a vertical brightness axis and the trajectory of color points on a plane perpendicular to the brightness axis. In our case, the luminance modification (tone-curve) is given by the tone mapping operator and we are allowed to modify only chrominance. Secondly, gamut mapping considers mostly mapping colors from one device to another of comparable dynamic range. When this plane moves up and down along the luminance axis, the boundary obtained by the intersection of the plane and the surface of the cube is a triangle or a hexagon. In this way, it can be seen intuitively that, on this plane, the angle between each primary color is 120°, the angle between the secondary color and the adjacent primary color is 60°, and the three primary colors and the three secondary colors are equally distributed across the plane 360° [17].The hue of this point is determined by the angle with a certain reference point. The angle between this point and the red axis is usually used. Specifying the red axis 0 means that the hue is 0, and the hue grows counterclockwise from this point. Saturation refers to the distance between the point and the vertical axis, that is, from the origin to the vector length of the point. The origin here refers to the intersection of the color plane and the brightness axis. The origin of different color planes is different. It can be seen that the important part of the HSI hue space is the vector formed from the brightness axis to the color point. The length of the vector and the angle formed by the vector and the red axis are considered. The HSI plane is commonly expressed in the form of hexagons, triangles, or circles just discussed. The HSI color model defines the normalized red, green, and blue values, which are given based on the original RGB values:(2)red=redRredR+greenG+blueB,(3)green=greenGredR+greenG+blueB,(4)blue=blueBredR+greenG+blueB.From theoretical analysis, it can be known that the RGB three-color components of an image can be converted into HSI color components. Suppose that after the RGB components are normalized, the maximum value of each component is 1 [18]. This allows us to derive in a separate equipment unit. The expression for this brightness is the sum of RGB values normalized to 1.(5)light=13redR+greenG+blueB.The next step is to obtain hue and saturation. Calculating the value of hue H requires constructing the geometric structure of the HSI triangle. The trajectory composed of all possibleR, G, and B values forms a triangle in the first hexagram limit of the RGB animation space. The vertices of this triangle are (1, 0, 0), (0, 1, 0), and (0, 0, 1). Let any point P in the triangle represent the position of a certain color in the RGB hue space. Let pr,g,b be the vector of the point P on the triangle. The vector at the center point represents white; α is the vector pointing to the red vertex of the triangle, representing pure red.The hue is the angle between the vectorp−α and the vector p−β, which rotates counterclockwise along the triangle and is far from the origin when viewed from the side of the triangle. This is based on the right-hand rule that the thumb points to the origin of the triangleα along the normal. The cosine of the resulting hue is(6)cosHSI=p−αp−βp−αp−β.The vectorw points to the center of the triangle as 1/3,1/3,1/3. The modulus of the vector p−α is(7)p−α=r−132+g−132+b−1321/2.This conclusion is derived to the following three formulas, which can be derived from a series of RGB values in the range of [0, 1] to derive the HSI value in the same range:(8)H=cos−11/2red−green+red−bluered−greenred−bluegreen−blue,S=1−infR,G,B3redR+greenG+blueB,I=13redR+greenG+blueB,p−β=23.


### 2.5. Realization of Animation Composition and Tone Space Conversion Algorithm

#### 2.5.1. Convert from RGB Tone Space to HSI Animation Space

Due to the mutual interference between the three channels of red, green, and blue, the display will inevitably produce certain errors when implementing the color management model conversion. It can be seen from the formula derived from the geometric derivation method that it is relatively simple to obtain the brightness and saturation. To calculate the brightness first, you only need to add the three values of R, G, and B. When you need to divide by 3 when calculating the brightness, one way is to multiply the original sum of the three RGB values by shifting by 3, and then shift the obtained value by 10 bits to the right to realize the shift calculation, to realize the operation of dividing by three; this method is to get an approximate result. Choose the drive parameters of the display to be 95, 160, and 240, respectively [19]. Drive the electron gun with a single-channel value, and measure the tristimulus value of the display and other parameters at the same time. The results are shown in Figure 4.Figure 4
HSI-XYZ measured value with RGB single-channel drive.Use the above red, green, and blue parameters 95, 160, and 240 to drive the display separately, measure the three stimulus valuesX, Y, and Z of the display, and the results of the measurement are also shown in Figure 5.Figure 5
XY standard error with RGB single-channel drive.Use the superposition principle to calculate the chromaticity tristimulus value of the display; the calculation formula is (4), because each single channel contains the influence of “black point” [20], so the calculation result is subtracted by twice the “black point” value column in Figure 6.Figure 6
Measured and calculated values ofX, Y, and Z of HSI with different combinations of RGB.The research shows that the stimulus value of the three primary colors of the display does not satisfy the complete superposition law; even if the value of the “black spot” is removed, the measured value ofX, Y, and Z is still generally slightly smaller than the calculated value, indicating that there is a three-way function for mutual inhibition, as shown in Figure 7. Through comparison, it is also found that as the display brightness value Y increases, the color difference value also increases accordingly [21]. This result proves that when the display brightness is higher, the red, green, and blue values are larger, and the mutual interference is also larger. Therefore, in order to avoid large interference between the channels, try to keep the monitor from working in areas that are too bright. In addition, from a health point of view, avoid strong eye irritation.Figure 7
Measured standard errors ofX, Y, and Z of HSI with different combinations of RGB.


#### 2.5.2. Analysis of Tone Uniformity in Animation Space

For displays, the reason why we use high-speed electrons that can reach every corner of the screen to excite the phosphor powder to produce spectral radiation is the deflection magnetic field of the line field. This is because of the gravity of the electrons, the mass of the deflection coil, and the phosphor screen. Due to the influence of the quality and the coating arrangement quality of the phosphor powder, the spectral radiation characteristic of the phosphor powder is not uniform on the entire screen. This error caused by the relationship between the spectral radiation characteristic of the phosphor powder and the position of the screen is called the spatial uniformity error. In order to analyze the error caused by spatial uniformity, different RGB combinations were used to produce different color blocks, and the color blocks of the same data were moved on different positions on the screen, and then the chromaticity parameters were measured to calculate the average color difference, which is listed in table Figure8.Figure 8
Chromaticity parameters when the same color block is in different positions on the screen.From the calculation result analysis, in the relatively darker part of the display, the spatial uniformity is poor, and the effect of the space-time uniformity of the midtone and the light-tone uniformity error on the display result will be smaller. The color displayed by the liquid crystal display is achieved by filtering the backlight by the color filter of each pixel, unlike the display which is formed by the deflection of the electron beam and bombarding the phosphor to emit light. Therefore, in theory, the uniformity of the display of the liquid crystal display is better than monitor. Display the same color on the entire screen, measure the color of each zone, compare the color difference of each zone, set the color according to the color value in Figure9, display the color on the full screen, and measure the color of each zone. Assuming that the color measurement value of the middle point is used as the reference color and the colors of other points are used as the sample color, the color difference relative to the middle point can be directly obtained. Figure 8 is the test result. The data in the table is the color difference measurement value relative to the middle area. Therefore, the color difference at the middle point is set to 0.Figure 9
The test animation shows the color value of uniformity.It can be seen from the data in Figure10 that the unevenness of the display does not gradually increase from the middle to the surrounding color difference, but shows an irregular undulating trend. The undulating law of different displays is also different, which may be related to the assembly of the display. In the display used in the experiment, the largest color difference is in the 3 and 4 areas, followed by the 1 area, and the data with larger color difference is almost all on the edge, and the data in the 2, 3, and 4 areas near the center are not. It will be the largest. According to the data, this is related to the uneven coating of the phosphor and the glue used for coating, etc. And during the test, it was found that, even at the middle point of the screen, due to the slight deviation of the repeated measurement position, there will be a small deviation. Therefore, the color difference data in the table does not accurately represent the color difference, but only reflects the trend of the color difference change.Figure 10
Animation showing uniformity test results.In addition, the nonuniformity of the display space of the monitor also shows that the color display of a certain position of the screen is affected by other surrounding points. Make a color block in the center of the display screen, keep the drive parameters unchanged, and the measurement points remain unchanged. The color block is surrounded by the background color. When the background color is changed, the parameters of the measurement color block will be changed. Through experimental research, the display does have uneven display colors. Under the same driving voltage, the light intensity is unevenly distributed on the screen, with bright center and dark edges. This brightness change can sometimes be as high as 25%. Therefore, the assumption of the uniformity of the display space is not strictly established. However, because the sensitivity of the human eye itself is often uneven for the observation field and the human eye has a good adaptability to this smooth change of brightness on the screen, it does not look obvious when observing the image; only when the display is large, the area is the same color, especially when it shows uniform gray. This is because the difference in the 3 color difference units itself is not obvious when the color comparison is not performed (color samples are compared side by side), and when the image has rich color levels, the color change will cover up the error caused by unevenness.


## 2.1. Animation Composition and Tone Space Conversion Algorithm

Color is the human eye’s perception of different frequencies of light, so color exists objectively, and on the other hand, color is the human eye’s perception, so color is also subjectively perceivable, and there are differences in perception [13]. Therefore, human beings’ understanding of color has gone through a rather long process, and it was not gradually perfected until modern times. Color space is also known as color gamut. In fact, it refers to the range of various color sets. In color science, many color models have been established to describe a certain color in one-dimensional, two-dimensional, three-dimensional, and even four-dimensional animation space coordinate systems. This coordinate system is defined as a hue space [14].Common hue spaces are RGB, CMYK, HSI, etc. They can be divided into multiple types of hue space standards. For example, RGB tone space can be divided into AdobeRGB, App1eRGB, ColorMatchRGB, etc. These tone space standards are specially formulated based on different hardware devices and are mostly used in their respective display devices and input and output devices. The combination of animation composition and tone space conversion is shown in Figure1.Figure 1
The combination of animation composition and tone space conversion algorithm.


## 2.2. Animation Composition

For grayscale images, the red, green, and blue components of a pixel are equal, but as the values of these components increase, the color of the pixel changes from black to white. The colors in nature can be combined with three colors of red, green, and blue, which are artificially divided into 256 levels, and various colors can be expressed through different combinations of RGB [14]. As can be seen from the above introduction, we can use the RGB tone space to represent a color digital image. Hue space is a mathematical model used to describe color, also known as color model. RGB tone space is the most common one in life, but the tone space used to express color information in image processing is more than this one. Different tone spaces help to analyze a color digital image from different angles. We only focus on the conversion of RGB and HSI tone spaces and then introduce these two tone spaces.According to the principle of chromaticity, the light of various colors in nature is composed of the three colors of red, green, and blue mixed in different proportions. Therefore, the light of various colors in nature can be decomposed into different degrees: red light, green light, and blue light, so we call the three colors of red, green, and blue the three primary colors. The hue space formed with the three primary colors as the coordinate system is called the RGB hue space. As we all know, basically all color imaging devices and color display devices use the three primary colors of red, green, and blue. In addition, the commonly used storage of digital image files is also based on the three primary colors of RGB [15]. In the application of multimedia computer technology, the RGB tone space is widely used. For video, multimedia, and web design, according to the principle of three primary colors, the light of primary colors is used to express the amount of light. The color matching equation of light of any color in the RGB tone space is as follows:(1)light=redR+greenG+blueB.The RGB color animation space is based on the principle of additive color mixing, from black to three colors of red, green, and blue. It can be seen from Figure2 that cyan is synthesized from blue and green, magenta is synthesized from red and blue, yellow is synthesized from green and red, and magenta, yellow, and cyan are exactly CMY (Cyan/Magenta/Yellow) three primary colors [16]. In addition, when the RGB three primary colors are mixed in equal proportions or equal amounts, black, gray, and white can be obtained. The proportions of the three colors of RGB are shown in Figure 2. It can be seen intuitively from Figure 2 that the eight colors of red, green, blue, magenta, yellow, cyan, black, and white are located at the 8 vertices of the cube, and black is usually placed in the three-dimensional coordinates of the RGB hue space. The origin of the system: red, green, and blue are in 3 coordinate systems, respectively, and the whole cube is within the limit of the first hexagram. Among them, red and cyan, green and magenta, and blue and yellow are complementary colors. The value range of each parameter is R 0-255; G 0-255; B 0-255. The parameter values of the three primary colors can also be referred to as the three color coefficients or color values or primary color coefficients, and each parameter value is normalized to obtain a value between 0 and 1. Since each gray level is defined as 28 = 256, different combinations of red, green, and blue components can represent 2563 = 16, 777, 216 colors, but the human eye can distinguish only a few thousand colors, which means the human eye can distinguish the gray scale [16]. There are dozens of levels, so the colors that RGB animation space can represent are much more than the colors that human eyes can distinguish.Figure 2
The structure of the animation space information system.The RGB three-primary color composite map and the RGB hue space coordinate system are shown in Figure2. It can be seen that, under the premise of ensuring the current status and positioning accuracy of the animation space information, the key to achieving the animation space information meeting the requirements of the whole society’s spatiotemporal information service is the accuracy of information expression, and color is the most accurate expression of information. Therefore, the colorization of animation spatial information and its color management are one of the key technologies to meet the needs of users for visualized products of animation spatial information.Due to the infinite complexity of the color expression of animation space information, it is necessary to carry out the complete expression of color digitization in computers with limited capacity and processing power and related equipment, and it is inevitable to associate color abstraction and synthesis problems. Therefore, to objectively express the color of animation spatial information, only through the selection, expression, and quantification of color information can it finally become the content of computer system management and processing, and it is related to these color models and their reproduction systems. In short, color management is a conceptual system involving the expression of animation spatial information. From a methodological point of view, the color management of animation spatial information is facing the problem of finding a reliable theoretical paradigm and model.


## 2.3. Tone Space

When people observe colored objects, they tend to describe them in terms of hue, brightness, and saturation. Figure3 shows RGB and HSI tone space conversion.Figure 3
RGB and HSI tone space conversion.We generally describe it in terms of hue, brightness, and saturation. Hue is the color attribute used to describe a pure color, and saturation is a measure of the degree to which a pure color is diluted by white light. Brightness is a relatively subjective descriptor, which also makes the concept of colorless brightness concretized. Brightness has also become one of the key factors in describing color perception. Hue is a color attribute used to describe a pure color, and saturation is a measure of the degree to which a pure color is diluted by white light. Brightness is a relatively subjective descriptor, which also makes the concept of colorless brightness concretized. Brightness has also become one of the key factors in describing color perception. Brightness, or grayscale, is the most useful descriptor for describing monochrome images. In addition, all points in the plane defined by the brightness axis and the edge of the cube have the same hue. This is because inside the colored triangle, the color is composed of the three vertex colors. The white and black components will only change the brightness and saturation of the point and have no effect on the color change. Rotating this plane with the brightness axis as the axis can get different tones. Therefore, the HSI tone space can be represented by a double cone. From this, the following conclusions can be drawn: the hue, saturation, and brightness values required to form the HSI hue space can all be obtained through the RGB hue space, and any point in the RGB hue space can be found in the HSI hue space.The segmented definition method is to analyze the conversion formula based on the colorimetric definition. From the basic concept of chromaticity, we can know that the tones of the three primary colors RGB are 0, 120, and 240, respectively. When one of the three RGB components is the largest, the component is considered to be the main component, and the hue is within the range of plus or minus 60 near the component. The magnitude of the deviation is normalized by the relative difference between the remaining two components. The HSI tone space model uses three parameters,H, S, I, to describe the characteristics of colors. Among them, H represents the wavelength of the color, also known as hue; S represents the degree of color depth, also known as saturation. In the color cube, assuming we are at the black origin (0, 0, 0), the diagonal direction is exactly the white fixed point (1, 1, 1) as shown in the cube. Associating with the black and white plane, the brightness is distributed along the line between the two vertices, which is the line that gradually changes from black to white. We call the line connecting black and white fixed points the brightness axis; this brightness axis is vertical. This plane and the intersection of the brightness axis are the brightness value of this color point [16]. Since the value of each color component is normalized, the range of this brightness value is between [0, 1]. In addition, you can notice from the figure that saturation is an amount that increases as the distance function from the brightness axis increases. The saturation of a point on the brightness axis is 0. In other words, the points on this axis are all grayscale tones.


## 2.4. Tone Space Conversion Algorithm

Based on the previous discussion about the HSI hue space, it can be seen that the HSI hue space is an animation space formed by a vertical brightness axis and the trajectory of color points on a plane perpendicular to the brightness axis. In our case, the luminance modification (tone-curve) is given by the tone mapping operator and we are allowed to modify only chrominance. Secondly, gamut mapping considers mostly mapping colors from one device to another of comparable dynamic range. When this plane moves up and down along the luminance axis, the boundary obtained by the intersection of the plane and the surface of the cube is a triangle or a hexagon. In this way, it can be seen intuitively that, on this plane, the angle between each primary color is 120°, the angle between the secondary color and the adjacent primary color is 60°, and the three primary colors and the three secondary colors are equally distributed across the plane 360° [17].The hue of this point is determined by the angle with a certain reference point. The angle between this point and the red axis is usually used. Specifying the red axis 0 means that the hue is 0, and the hue grows counterclockwise from this point. Saturation refers to the distance between the point and the vertical axis, that is, from the origin to the vector length of the point. The origin here refers to the intersection of the color plane and the brightness axis. The origin of different color planes is different. It can be seen that the important part of the HSI hue space is the vector formed from the brightness axis to the color point. The length of the vector and the angle formed by the vector and the red axis are considered. The HSI plane is commonly expressed in the form of hexagons, triangles, or circles just discussed. The HSI color model defines the normalized red, green, and blue values, which are given based on the original RGB values:(2)red=redRredR+greenG+blueB,(3)green=greenGredR+greenG+blueB,(4)blue=blueBredR+greenG+blueB.From theoretical analysis, it can be known that the RGB three-color components of an image can be converted into HSI color components. Suppose that after the RGB components are normalized, the maximum value of each component is 1 [18]. This allows us to derive in a separate equipment unit. The expression for this brightness is the sum of RGB values normalized to 1.(5)light=13redR+greenG+blueB.The next step is to obtain hue and saturation. Calculating the value of hue H requires constructing the geometric structure of the HSI triangle. The trajectory composed of all possibleR, G, and B values forms a triangle in the first hexagram limit of the RGB animation space. The vertices of this triangle are (1, 0, 0), (0, 1, 0), and (0, 0, 1). Let any point P in the triangle represent the position of a certain color in the RGB hue space. Let pr,g,b be the vector of the point P on the triangle. The vector at the center point represents white; α is the vector pointing to the red vertex of the triangle, representing pure red.The hue is the angle between the vectorp−α and the vector p−β, which rotates counterclockwise along the triangle and is far from the origin when viewed from the side of the triangle. This is based on the right-hand rule that the thumb points to the origin of the triangleα along the normal. The cosine of the resulting hue is(6)cosHSI=p−αp−βp−αp−β.The vectorw points to the center of the triangle as 1/3,1/3,1/3. The modulus of the vector p−α is(7)p−α=r−132+g−132+b−1321/2.This conclusion is derived to the following three formulas, which can be derived from a series of RGB values in the range of [0, 1] to derive the HSI value in the same range:(8)H=cos−11/2red−green+red−bluered−greenred−bluegreen−blue,S=1−infR,G,B3redR+greenG+blueB,I=13redR+greenG+blueB,p−β=23.


## 2.5. Realization of Animation Composition and Tone Space Conversion Algorithm

### 2.5.1. Convert from RGB Tone Space to HSI Animation Space

Due to the mutual interference between the three channels of red, green, and blue, the display will inevitably produce certain errors when implementing the color management model conversion. It can be seen from the formula derived from the geometric derivation method that it is relatively simple to obtain the brightness and saturation. To calculate the brightness first, you only need to add the three values of R, G, and B. When you need to divide by 3 when calculating the brightness, one way is to multiply the original sum of the three RGB values by shifting by 3, and then shift the obtained value by 10 bits to the right to realize the shift calculation, to realize the operation of dividing by three; this method is to get an approximate result. Choose the drive parameters of the display to be 95, 160, and 240, respectively [19]. Drive the electron gun with a single-channel value, and measure the tristimulus value of the display and other parameters at the same time. The results are shown in Figure 4.Figure 4
HSI-XYZ measured value with RGB single-channel drive.Use the above red, green, and blue parameters 95, 160, and 240 to drive the display separately, measure the three stimulus valuesX, Y, and Z of the display, and the results of the measurement are also shown in Figure 5.Figure 5
XY standard error with RGB single-channel drive.Use the superposition principle to calculate the chromaticity tristimulus value of the display; the calculation formula is (4), because each single channel contains the influence of “black point” [20], so the calculation result is subtracted by twice the “black point” value column in Figure 6.Figure 6
Measured and calculated values ofX, Y, and Z of HSI with different combinations of RGB.The research shows that the stimulus value of the three primary colors of the display does not satisfy the complete superposition law; even if the value of the “black spot” is removed, the measured value ofX, Y, and Z is still generally slightly smaller than the calculated value, indicating that there is a three-way function for mutual inhibition, as shown in Figure 7. Through comparison, it is also found that as the display brightness value Y increases, the color difference value also increases accordingly [21]. This result proves that when the display brightness is higher, the red, green, and blue values are larger, and the mutual interference is also larger. Therefore, in order to avoid large interference between the channels, try to keep the monitor from working in areas that are too bright. In addition, from a health point of view, avoid strong eye irritation.Figure 7
Measured standard errors ofX, Y, and Z of HSI with different combinations of RGB.


### 2.5.2. Analysis of Tone Uniformity in Animation Space

For displays, the reason why we use high-speed electrons that can reach every corner of the screen to excite the phosphor powder to produce spectral radiation is the deflection magnetic field of the line field. This is because of the gravity of the electrons, the mass of the deflection coil, and the phosphor screen. Due to the influence of the quality and the coating arrangement quality of the phosphor powder, the spectral radiation characteristic of the phosphor powder is not uniform on the entire screen. This error caused by the relationship between the spectral radiation characteristic of the phosphor powder and the position of the screen is called the spatial uniformity error. In order to analyze the error caused by spatial uniformity, different RGB combinations were used to produce different color blocks, and the color blocks of the same data were moved on different positions on the screen, and then the chromaticity parameters were measured to calculate the average color difference, which is listed in table Figure8.Figure 8
Chromaticity parameters when the same color block is in different positions on the screen.From the calculation result analysis, in the relatively darker part of the display, the spatial uniformity is poor, and the effect of the space-time uniformity of the midtone and the light-tone uniformity error on the display result will be smaller. The color displayed by the liquid crystal display is achieved by filtering the backlight by the color filter of each pixel, unlike the display which is formed by the deflection of the electron beam and bombarding the phosphor to emit light. Therefore, in theory, the uniformity of the display of the liquid crystal display is better than monitor. Display the same color on the entire screen, measure the color of each zone, compare the color difference of each zone, set the color according to the color value in Figure9, display the color on the full screen, and measure the color of each zone. Assuming that the color measurement value of the middle point is used as the reference color and the colors of other points are used as the sample color, the color difference relative to the middle point can be directly obtained. Figure 8 is the test result. The data in the table is the color difference measurement value relative to the middle area. Therefore, the color difference at the middle point is set to 0.Figure 9
The test animation shows the color value of uniformity.It can be seen from the data in Figure10 that the unevenness of the display does not gradually increase from the middle to the surrounding color difference, but shows an irregular undulating trend. The undulating law of different displays is also different, which may be related to the assembly of the display. In the display used in the experiment, the largest color difference is in the 3 and 4 areas, followed by the 1 area, and the data with larger color difference is almost all on the edge, and the data in the 2, 3, and 4 areas near the center are not. It will be the largest. According to the data, this is related to the uneven coating of the phosphor and the glue used for coating, etc. And during the test, it was found that, even at the middle point of the screen, due to the slight deviation of the repeated measurement position, there will be a small deviation. Therefore, the color difference data in the table does not accurately represent the color difference, but only reflects the trend of the color difference change.Figure 10
Animation showing uniformity test results.In addition, the nonuniformity of the display space of the monitor also shows that the color display of a certain position of the screen is affected by other surrounding points. Make a color block in the center of the display screen, keep the drive parameters unchanged, and the measurement points remain unchanged. The color block is surrounded by the background color. When the background color is changed, the parameters of the measurement color block will be changed. Through experimental research, the display does have uneven display colors. Under the same driving voltage, the light intensity is unevenly distributed on the screen, with bright center and dark edges. This brightness change can sometimes be as high as 25%. Therefore, the assumption of the uniformity of the display space is not strictly established. However, because the sensitivity of the human eye itself is often uneven for the observation field and the human eye has a good adaptability to this smooth change of brightness on the screen, it does not look obvious when observing the image; only when the display is large, the area is the same color, especially when it shows uniform gray. This is because the difference in the 3 color difference units itself is not obvious when the color comparison is not performed (color samples are compared side by side), and when the image has rich color levels, the color change will cover up the error caused by unevenness.


## 2.5.1. Convert from RGB Tone Space to HSI Animation Space

Due to the mutual interference between the three channels of red, green, and blue, the display will inevitably produce certain errors when implementing the color management model conversion. It can be seen from the formula derived from the geometric derivation method that it is relatively simple to obtain the brightness and saturation. To calculate the brightness first, you only need to add the three values of R, G, and B. When you need to divide by 3 when calculating the brightness, one way is to multiply the original sum of the three RGB values by shifting by 3, and then shift the obtained value by 10 bits to the right to realize the shift calculation, to realize the operation of dividing by three; this method is to get an approximate result. Choose the drive parameters of the display to be 95, 160, and 240, respectively [19]. Drive the electron gun with a single-channel value, and measure the tristimulus value of the display and other parameters at the same time. The results are shown in Figure 4.Figure 4
HSI-XYZ measured value with RGB single-channel drive.Use the above red, green, and blue parameters 95, 160, and 240 to drive the display separately, measure the three stimulus valuesX, Y, and Z of the display, and the results of the measurement are also shown in Figure 5.Figure 5
XY standard error with RGB single-channel drive.Use the superposition principle to calculate the chromaticity tristimulus value of the display; the calculation formula is (4), because each single channel contains the influence of “black point” [20], so the calculation result is subtracted by twice the “black point” value column in Figure 6.Figure 6
Measured and calculated values ofX, Y, and Z of HSI with different combinations of RGB.The research shows that the stimulus value of the three primary colors of the display does not satisfy the complete superposition law; even if the value of the “black spot” is removed, the measured value ofX, Y, and Z is still generally slightly smaller than the calculated value, indicating that there is a three-way function for mutual inhibition, as shown in Figure 7. Through comparison, it is also found that as the display brightness value Y increases, the color difference value also increases accordingly [21]. This result proves that when the display brightness is higher, the red, green, and blue values are larger, and the mutual interference is also larger. Therefore, in order to avoid large interference between the channels, try to keep the monitor from working in areas that are too bright. In addition, from a health point of view, avoid strong eye irritation.Figure 7
Measured standard errors ofX, Y, and Z of HSI with different combinations of RGB.


## 2.5.2. Analysis of Tone Uniformity in Animation Space

For displays, the reason why we use high-speed electrons that can reach every corner of the screen to excite the phosphor powder to produce spectral radiation is the deflection magnetic field of the line field. This is because of the gravity of the electrons, the mass of the deflection coil, and the phosphor screen. Due to the influence of the quality and the coating arrangement quality of the phosphor powder, the spectral radiation characteristic of the phosphor powder is not uniform on the entire screen. This error caused by the relationship between the spectral radiation characteristic of the phosphor powder and the position of the screen is called the spatial uniformity error. In order to analyze the error caused by spatial uniformity, different RGB combinations were used to produce different color blocks, and the color blocks of the same data were moved on different positions on the screen, and then the chromaticity parameters were measured to calculate the average color difference, which is listed in table Figure8.Figure 8
Chromaticity parameters when the same color block is in different positions on the screen.From the calculation result analysis, in the relatively darker part of the display, the spatial uniformity is poor, and the effect of the space-time uniformity of the midtone and the light-tone uniformity error on the display result will be smaller. The color displayed by the liquid crystal display is achieved by filtering the backlight by the color filter of each pixel, unlike the display which is formed by the deflection of the electron beam and bombarding the phosphor to emit light. Therefore, in theory, the uniformity of the display of the liquid crystal display is better than monitor. Display the same color on the entire screen, measure the color of each zone, compare the color difference of each zone, set the color according to the color value in Figure9, display the color on the full screen, and measure the color of each zone. Assuming that the color measurement value of the middle point is used as the reference color and the colors of other points are used as the sample color, the color difference relative to the middle point can be directly obtained. Figure 8 is the test result. The data in the table is the color difference measurement value relative to the middle area. Therefore, the color difference at the middle point is set to 0.Figure 9
The test animation shows the color value of uniformity.It can be seen from the data in Figure10 that the unevenness of the display does not gradually increase from the middle to the surrounding color difference, but shows an irregular undulating trend. The undulating law of different displays is also different, which may be related to the assembly of the display. In the display used in the experiment, the largest color difference is in the 3 and 4 areas, followed by the 1 area, and the data with larger color difference is almost all on the edge, and the data in the 2, 3, and 4 areas near the center are not. It will be the largest. According to the data, this is related to the uneven coating of the phosphor and the glue used for coating, etc. And during the test, it was found that, even at the middle point of the screen, due to the slight deviation of the repeated measurement position, there will be a small deviation. Therefore, the color difference data in the table does not accurately represent the color difference, but only reflects the trend of the color difference change.Figure 10
Animation showing uniformity test results.In addition, the nonuniformity of the display space of the monitor also shows that the color display of a certain position of the screen is affected by other surrounding points. Make a color block in the center of the display screen, keep the drive parameters unchanged, and the measurement points remain unchanged. The color block is surrounded by the background color. When the background color is changed, the parameters of the measurement color block will be changed. Through experimental research, the display does have uneven display colors. Under the same driving voltage, the light intensity is unevenly distributed on the screen, with bright center and dark edges. This brightness change can sometimes be as high as 25%. Therefore, the assumption of the uniformity of the display space is not strictly established. However, because the sensitivity of the human eye itself is often uneven for the observation field and the human eye has a good adaptability to this smooth change of brightness on the screen, it does not look obvious when observing the image; only when the display is large, the area is the same color, especially when it shows uniform gray. This is because the difference in the 3 color difference units itself is not obvious when the color comparison is not performed (color samples are compared side by side), and when the image has rich color levels, the color change will cover up the error caused by unevenness.


## 3. Conclusion

Based on the introduction of hue space, this article introduces the concept of hue space conversion and introduces its application scenarios. The most common application in the application is the function of image display. Therefore, it first introduces the conversion of RGB tone space to HSI tone space. Since this mutual conversion is relatively simple and easy to implement, a small amount of space is used to introduce its conversion method and data stream transmission format. Secondly, we introduce the mutual conversion between the RGB tone space and the HSI tone space that this article focuses on and describe in detail how each color component in the HSI tone space is converted from the three color components of RGB from a geometric point of view. The conversion formula is deduced, and several general conversion methods of RGB to HSI tone space are introduced; finally, two conversion methods of geometric derivation and standard modular arithmetic are implemented in the software, and the comparison is verified, and the hardware is implemented. From the perspective of comparing the pros and cons of the two methods, it provides theoretical support for the next step of transplanting hardware. The content of this design is mainly the category of digital image processing preprocessing. Because it is only a staged work and my level is limited, there are still many problems to be solved. For the entire image processing system, this design is only a preprocessing subsystem in the middle. In actual use, more advanced motion detection can be performed on the image signal, such as image recognition and other more in-depth research. The direction of work also tends to research in this area; in the further design of image processing, an embedded controller can be added to control the data flow, and the data flow between each processing module can be overall scheduled. In this way, the entire system can be better built, and the data input and output between each module can be controlled more conveniently, so that the development is clear and systematic.



---

*Source: 5579547-2021-04-22.xml*