RYB Color Compositing
Total Page:16
File Type:pdf, Size:1020Kb
RYB Color Compositing Junichi Sugita Tokiichiro Takahashi Tokyo Healthcare University / Tokyo Denki University Tokyo Denki University / UEI Research Tokyo, Japan Tokyo, Japan [email protected] [email protected] (a) RGB color compositing (b) RYB color compositing (c) Itten’s RYB color wheel (d) Stroke compositing in RYB color space Fig. 1. Intuitive color compositing Abstract—This paper introduce an equation to convert from Red and yellow makes orange, yellow and blue makes green, RGB to RYB and the inverse conversion equation as a model of and red and blue makes purple. Composited three colors get RYB color space. Proposal RYB color model allows paint like close to black (See Fig. 1. (b)). compositing easily without complex configuration of parameters such as Kubelka-Munk model. Meanwhile, there is a physical model for compositing pigments such as that of KM model [3], [4], [5]. The KM Keywords— RYB; Color; Compositing; Mixing model is able to analytically calculate reflectance and transparency of scattering materials such as paint pigment. I. INTRODUCTION However, it is difficult to use because the KM model requires many parameters. In addition, KM model has the limitation of Color compositing is a commonly used operation in usable colors due to a requirement of predefined pigment computer graphics. There are two general approach: either library. compositing in RGB color space, or physical model using Kubelka-Munk (KM) theory [1]. However, the former fails to For compositing colors that more closely resemble the reproduce paint like appearances, while the latter is difficult to expectations of those not trained in the RGB color space, the use. RYB color space is thought of as intuitive approach. For this reason, modelization of the RYB color space on computer is Most computer graphics applications make use of the RGB useful and several application can be expected. color space which is defined by the three chromaticities of the red, green, and blue primaries. The RGB color model is an This paper introduce an equation to convert from RGB to additive color model (See Fig. 1. (a)). Simple alpha blending in RYB and the inverse conversion equation. By converting RYB RGB color space maps onto the traditional color compositing color space with the conversion equation, we regain normal use pipeline. However, RGB color compositing fails to reproduce of simple color compositing method in RYB color space, for paint like appearance such as “yellow and blue makes green”. example alpha-blending, without complex configuration of parameters such as KM model. Experimental results verify the CMYK is well known color model for subtractive color effectiveness of proposal RYB color model. compositing used in printing. Similar to RGB, CMYK also fails to reproduce paint like appearance. II. RELATED WORK Many people have been used subtractive color model based There are a number of extensive studies on physical on pigment color compositing since early childhood. RYB pigment model to calculate the compositing color for realistic color model by Johannes Itten is widely used in art education natural digital media painting system. However, there is few [2]. Fig. 1. (c) shows Itten’s RYB color wheel. In the RYB study on converting color space from RGB to RYB. color model, red, yellow and blue are defined as primary colors. Several digital media painting system have used KM model Here, min() is a function for calculating min value from input for producing composited colors [3], [4], [5]. Baxter et al. [6] arguments. RYB values, rryb, yryb, bryb, are obtained from rrgb, proposed a strokes paint system using KM model with a grgb, brgb by the following equation. numerical approximation of the same pigments. Curtis et al. [6] r r min(r , g ) used reduced KM model for rendering watercolor. Wang and ryb rgb rgb rgb Wang [7] proposed further approximation which uses a single grgb min(rrgb , grgb ) (3) y coefficient variant of KM model. The wax crayon simulation of ryb 2 Rudolf et al. [8] uses simple approximation of KM model. b g min(r , g ) b rgb rgb rgb rgb However, KM model is difficult to use because this model ryb 2 requires many parameters. Moreover, usable colors is limited We normalize the equation (3) as: to the number of predefined pigment library. rryb r In order to improve the problem, Lu et al. [10] proposed a ryb n data-driven model for compositing colors. Although this model y (4) not requires complex configuration of parameters but requires ryb yryb n 0 predefined colors as an input. n b Gossett and Chen [11] proposed paint inspired RYB color ryb bryb model. As far as we examined, this is the only research to n convert from RGB to RYB. Gossett and Chen defined three Here, n is calculated as follows: paint pigment primaries and tri-linearly interpolated among max(r , y ,b ) them. However, this model is irreversible conversion, because n ryb ryb ryb (5) interpolated color is depend on defined pigment primary colors. max(rrgb , grgb ,brgb ) And this paper do not provided clear mechanism for converting Here, max() is a function for calculating max value from input RYB to RGB. arguments. These and other studies provided useful information. Finally, black component are added for subtractive color However, the conversion equation from RGB to RYB has not mixing, and RYB values, Rryb, Yryb, Bryb, are obtained as been generally provided in the literature. follows: III. RYB COLOR MODEL Rryb rryb Ib In this chapter, we describe the method of interconversion (6) Yryb yryb Ib between RGB and RYB color space. Ideal correspondence values between RGB to RYB show Table 1. The number of Bryb bryb Ib each RGB or RYB channel ranges from 0 to 1. We propose the Here, I can be calculated as follows: conversion equation in agreement with the values of Table 1. b Ib min(1 Rrgb ,1 Grgb ,1 Brgb ) (7) TABLE 1. CORRESPONDING VALUES BETWEEN RGB AND RYB Color RGB RYB (0, 0, 0) (1, 1, 1) B. RYB to RGB Conversion (1, 0, 0) (1, 0, 0) In this section, we describe the conversion from RGB to (0, 1, 0) (0, 1, 1) (0, 0, 1) (0, 0, 1) RYB. Rryb, Yryb, Bryb are given RYB values as an input. (1, 1, 0) (0, 1, 0) Whiteness component is removed from Rryb, Yryb, Bryb by the (1, 0, 1) (1, 0, 0.5) following equation. (0, 1, 1) (0, 0.5, 1) (1, 1, 1) (0, 0, 0) rryb Rryb I w (8) A. RGB to RYB Conversion yryb Yryb I w We introduce how to make the conversion from the RGB to bryb Brgb I w RYB color space. Rrgb, Grgb, Brgb are given RGB values as an Here, I is calculated as follows: input. Whiteness component is removed from R , G , B by w rgb rgb rgb I min(R ,Y , B ) (9) the following equation. w ryb ryb ryb RGB values, rrgb, grgb, brgb, are obtained from rryb, yryb, bryb by rrgb Rrgb I w the following equation. (1) g rgb Grgb I w rrgb rryb yryb min(yryb ,bryb ) (10) brgb Brgb I w gryb yryb 2min(yryb ,bryb ) Here, Iw can be calculated as follows: brgb 2bryb min(yryb ,bryb ) I min(R ,G , B ) w rgb rgb rgb (2) We normalize the equation (10) as: show results as luminance = 200. Fig. 2. (c) is brighter than Fig. rrgb rrgb 2. (a) because RGB is additive color model. On the other hand, n Fig. 2. (d) is darker than Fig. 2. (b). It means that the proposed grgb (11) RYB color model realized subtractive color model. grgb n 0 n brgb brgb n Here, n is calculated as follows: max(r , g ,b ) n ryb ryb ryb (12) max(rrgb , yrgb ,brgb ) Finally, black component are added, and RGB values, Rrgb, Grgb, Brgb, are obtained as follows: Rrgb rrgb Ib (13) Grgb grgb Ib (a) RGB (Luminance = 100) Brgb brgb Ib Here, Ib can be calculated as follows: Ib min(1 Rryb ,1Yryb ,1 Bryb ) (14) IV. EXPERIMENTAL RESULTS To verify effectiveness of proposed RYB model, the authors performed several experiments. A. Results of Color Compositing Fig. 1. (b) shows the result using proposed RYB color model. Composited color Ccomp is calculated from two colors, (b) RYB (Luminance = 100) C1, C2, by following equation. Ccomp C1 C2 (15) As shown in Fig. 1. (b), we could observe the paint like compositing such as “yellow and blue make green”. Fig. 1. (d) shows result of stroke compositing in the proposed RYB color space. This results used alpha blending method which is defined by following equation. Cblend C1 1 C2 (16) Cblend is composited color from C1 and C2. α is 0.5 in Fig. 1. (d). As shown in Fig. 1. (d), we could observe the paint like appearance. By using the proposed RYB color space, we (c) RGB (Luminance = 200) regain normal use of simple alpha blending method for compositing colors. The proposed RYB color model allows paint like compositing easily without complex configuration of parameters such as Kubelka-Munk model. B. Whole context of proposed RYB Color Model To understand the whole context of the proposed RYB color model, we converted from RYB to HSL color space. For comparison, we also converted from RGB to HSL color space. Fig. 2. shows relationship between hue and saturation in HSL color space. The vertical axis is luminance, the horizontal axis is hue. The number of hue ranges from 0 to 360, saturation and luminance ranges from 0 to 255. Fig. 2. (a) and (b) show (d) RYB (Luminance = 200) results for the case of luminance = 100.