Saturation-Improved Hue-Preserving Gamut Mapping by Weighted Histogram Specification

This paper proposes a method for improving the saturation of colors in hue-preserving gamut mapping. The proposed method uses three planes bounded by highly saturated edges of RGB color cube for hue-preserving gamut mapping. Firstly, each color is projected onto one of the three planes to increase the saturation. Then the projected color is transformed into the target color with a designated luminance and the same hue as the original color. Furthermore, a saturation-weighted histogram specification method is also proposed and combined with the proposed gamut mapping method for improving the saturation further than the gamut mapping methods with conventional histogram equalization. Experimental results show that the proposed method can enhance the saturation of color images better than recent hue-preserving gamut mapping methods.


Introduction
In color image enhancement, hue-preserving gamut mapping is frequently required to preserve the appearance of image contents. Recently, Naik and Murthy [1] have proposed a hue-preserving color image enhancement method for enhancing the contrast of color images without the gamut problem, i.e., the enhanced colors may go outside the permitted color range. Han et al. [2] also proposed the equivalent method from a viewpoint of 3-D color histogram equalization. However, Naik and Murthy's method cannot only increase the saturation of colors to be enhanced, but also often decreases it. To overcome this problem, Yang and Lee [3] proposed a modified hue-preserving gamut mapping method that provides higher saturation than Naik and Murthy's one. In Yang and Lee's method, the range of luminance is equally divided into three parts that correspond to dark, middle and bright colors, and the saturation of dark and bright colors can be enhanced. However, the other colors falling into the middle range of luminance are handled in the same way as Naik and Murthy's method, and therefore, the saturation of the colors in the middle range is not increased even if Yang and Lee's method is used.
In this paper, we propose an improved method for huepreserving gamut mapping where all chromatic colors have the potential to have their saturation increased. We also propose a weighted histogram specification (HS) [4] method with a saturation-weighted target histogram which is computed from an input color image, and combine the proposed HS method with the proposed gamut mapping method. We experimentally compare the proposed method with Naik and Murthy's and Yang and Lee's methods, and demonstrate that the saturation of color images is improved by the proposed method better than the compared methods.
The rest of this paper is organized as follows. Section 2 summarizes previous hue-preserving gamut mapping methods. Section 3 describes the proposed gamut mapping method. Section 4 describes the proposed histogram specification method. Section 5 shows experimental results. Finally, Section 6 concludes this paper.

Previous Methods for Hue-Preserving Gamut Mapping
In this section, we first show the properties of color saturation, and then briefly summarize previous methods proposed by Naik and Murthy [1] and Yang and Lee [3].

Color Saturation
T be an RGB color vector in RGB color space, where r, g and b denote the R (red), G (green) and B (blue) values, respectively, and satisfy 0 ≤ p i ≤ 1 for i = 1, 2, 3, and the superscript T denotes the matrix transpose. Then the intensity of p is defined by l = r +g+b = , and the saturation of p is the distance from the intensity axis to p [5]: where Proof. Substituting up for p in (1), we have Proof.
□ Let f (l) ∈ [0, 3] be a function of l ∈ [0, 3] for transforming the intensity of a gray scale image into the modified one. For the convenience of the following description, let l t be the target intensity, which will be given by l t = f (l) in Naik's method, and let α = l t /l = f (l)/l be the ratio of l t to l. Then Naik's method [1] can be summarized as follows.

Naik's Method
If α ≤ 1, then the modified color T of p is given by p ′ = αp or p ′ i = αp i for i = 1, 2, 3; or else, first, p is transformed into the CMY (cyan, magenta and yellow) color vector as q = [q 1 , q 2 , q 3 ] T = 1 − p. Then the modified CMY color vector is given by q ′ = 3−l t 3−l q. Finally, q ′ is transformed back into the RGB color vector as The pseudocode of Naik's method is shown in Algorithm 1.

Algorithm 1 Naik's method
Require: RGB color vector p = [r, g, b] T , target intensity l t Ensure: modified color vector p ′ 1: Compute the intensity of p as l = r + g + b; 2: α := l t /l; 3: if α ≤ 1 then 4: p ′ := α p; 5: else 6: We define a function that compute the above Naik's method as follows: (11) Then we have the following property: Property 3. Naik's method described in Algorithm 1 does not increase the saturation: Proof. If α ≤ 1, then we have ψ Naik ( p, l t ) = αp. From Property 1, it follows that S (ψ Naik ( p, Yang and Lee also pointed out that the saturation of the enhanced color image by Naik's method decreases compared with that of the original one, and proposed a modified hue-preserving gamut mapping method as summarized in the following subsection [3].

Yang's Method
First, the RGB color space is divided into three parts by two equiintensity planes l = 1 and l = 2: l ≤ 1, 1 < l ≤ 2 and 2 < l. For a dark color p with l ≤ 1, the intensity of p is boosted up asp = p/l whose intensity is 1, and then Naik's method is applied top with the target intensity l t . For a moderate color p with 1 < l ≤ 2, Naik's method is applied to p directly. For a bright color p with l > 2, p is transformed into the CMY color vector q = 1 − p, and then the intensity of q is dropped down as q = q/(3 − l) to have the RGB color vector asp = 1 −q whose intensity is 2. Finally, Naik's method is applied top.
The pseudocode of Yang's method is shown in Algorithm 2.

Algorithm 2 Yang's method
Require: RGB color vector p = [r, g, b] T , target intensity l t Ensure: modified color vector p ′′ 1: Compute the intensity of p as l = r + g + b; 2: if l ≤ 1 then 3:p := p/l; 4: p ′′ := ψ Naik (p, l t ); 5: else if 1 < l ≤ 2 then p ′′ := ψ Naik (p, l t ); 10: end if We define a function that compute the above Yang's method as follows: Then we have the following property: Property 4. The saturation given by Yang's method described in Algorithm 2 is greater than or equal to that given by Naik's method described in Algorithm 1: Proof. If l ≤ 1, then there are three cases as follows: and ψ Yang ( p, l t ) = l t l p by Algorithms 1 and 2, respectively. From Properties 2 and 1, it follows that S (ψ Naik ( p, l t )) = 3−l t 3−l S (p) and S (ψ Yang ( p, l t )) = l t l S ( p), respectively. Therefore, we have that S (ψ Yang in the same way as the above. We also have ψ Yang If l > 2, then there are three cases as follows: whose intensity is 2, by Algorithms 1 and 2, respectively. From Properties 1 and 2, it follows that S (ψ Naik ( p, l t )) = αS (p) and S (ψ Yang . For 2 < l t ≤ l, we have S (ψ Naik ( p, l t )) = αS ( p) in the same way as the above. We also have ψ Yang , by Algorithms 1 and 2, respectively. From Property 2, we have S (ψ Naik . Consequently, (14) holds in any case. □

Proposed Gamut Mapping Method
As described above, Yang's method [3] is equivalent to Naik's method [1] when 1 < l ≤ 2. Therefore, in that case, both methods decrease the color saturation. In this section, we propose a hue-preserving gamut mapping method that produces higher saturation than the above two methods. Figure 1 shows three planes bounded by highly-saturated edges of RGB color cube, where the capital letters 'K', 'R', 'G', 'B', 'W', 'C', 'M' and 'Y' labeled on the vertices denote black, red, green, blue, white, cyan, magenta and yellow colors, respectively. The colors of the planes indicate that the planes from left to right in Fig. 1 are parallel to the R, G and B axes of the RGB color space, respectively. The projection of any color onto one of the three planes can increase the saturation of the color. The unit normal vectors of those planes are given by For a color p, we select one of the three planes by where the function 'median' selects the median value from given values. For example, if i p = 1, then p i p = p 1 = r is the median value among r, g and b. In this case, g or b is the maximal value, and therefore, the extension of p by a scalar multiplication intersects with the red plane in Fig.  1 before it goes outside the gamut of the RGB color cube. The equation of the plane with normal vector u i p is given by where p 0 denotes a point on the plane. Letp = αp, thenp may go outside the gamut when α is large. To avoid such a gamut problem, we first project p onto the above-mentioned plane with unit normal vector u i p , and then apply Naik's method to the projected color point. The detailed procedure is as follows: Therefore, the intersection point is given by x p = p/(p i a + p i b ). Then we apply Naik's method to x p to have p ′′′ = ψ Naik (x p , l t ). ii) If u T i p p > θ, then we compute the intersection point of a line passing through p and 1, a point on which is given by p γ = 1 + γ(p − 1), and a plane u T i p p 0 = θ, where a parameter γ is given by γ = 1/(2 − p i a − p i b ) at the intersection point. Therefore, the intersection point is given by y p = 1 + ( p − 1)/(2 − p i a − p i b ). Then we apply Naik's method to y p to have p ′′′ = ψ Naik (y p , l t ).
The pseudocode of the proposed method is shown in Algorithm 3.

Algorithm 3 The proposed method
Require: RGB color vector p = [p 1 , p 2 , p 3 ] T , target intensity l t Ensure: modified color vector p ′′′ 1: Compute the intensity of p as l = r + g + b; 2: θ := 1/ √ 2; 3: u 1 := θ[0, 1, 1] T , u 2 := θ[1, 0, 1] T , u 3 := θ[1, 1, 0] T ; 4: Compute i p = arg median i∈{1,2,3} (p i ); 5: x p := p/(p ia + p i b ); 9: p ′′′ := ψ Naik (x p , l t ); 10: else 11: We define a function that compute the above proposed method as follows: Then we have the following property: Property 5. The saturation given by the proposed method described in Algorithm 3 is greater than or equal to that given by Yang's method described in Algorithm 2: Proof. All combinations of the original and target intensities for a given color p are listed in Table 1, where l x denotes the intensity of x p , and is given by l x = l/(p i a + p i b ), and l y denotes the intensity of y p , and is given by l y = 3 + (l − 3)/(2 − p i a − p i b ). For each case, (18) is proved by using Properties 1 and 2 as follows.
In Case 1-1, we have ψ Yang ( p, l t ) = ψ Naik (p, l t ) = l tp = l t p/l, which is equal to ψ Prop ( p, l t ) = ψ Naik (x p , l t ) = l t (p i a + p i b ) p/[l(p i a + p i b )] = l t p/l. Therefore, we have S (ψ Prop ( p, l t )) = S (ψ Yang ( p, l t )).
In Case 1-2, we have ψ Yang ( p, l t ) = 1 − 3−l t 2 (1 −p) the saturation of which is S (ψ Yang (p, l t )) = 3−l t 2l S ( p). On the other hand, the saturation given by the proposed method is the same as that in Case 1-1, i.e., S (ψ Prop ( p, l t )) = l t l S ( p). Therefore, we have S (ψ Prop ( p, l t ))−S (ψ Yang and l x = l/(p i a + p i b ). The saturation given by Yang's method is the same as that in Case 1-2, i.e., S (ψ Yang ( p, l t )) = 3−l t 2l S ( p). Then we have S (ψ Prop ( p, l t )) − S (ψ Yang In Case 2-1, from ψ Yang ( p, l t ) = ψ Naik ( p, l t ) = l t l p and ψ Prop ( p, l t ) = ψ Naik (x p , l t ) = l t l x x p = l t l x l x l p = l t l p, we have S (ψ Prop ( p, l t )) = S (ψ Yang ( p, l t )).
In Case 2-2, we have S (ψ Prop (p, l t )) = l t l S ( p) as in Case 2-1, and S (ψ Yang . Since the saturation given by Yang's method is the same as that in Case 2-2, we have S (ψ Prop ( p, l t )) − S (ψ Yang Since the saturation given by Yang's method is the same as that in Case 3-1, , from which we have S (ψ Yang (p, l t )) = 3−l t 3−l S ( p) which is the same as the saturation given by the proposed method, i.e., S (ψ Yang ( p, l t )) = S (ψ Prop ( p, l t )).
Consequently, (18) holds in any case. □ In summary, from Properties 4 and 5, we have the following inequality: which shows the order of the saturation values given by Naik's, Yang's and the proposed methods.

Saturation-Weighted Histogram Specification
In Naik's [1] and Yang's [3] methods, histogram equalization (HE) [5] is typically used for the intensity transformation f (l). However, HE does not necessarily improve the saturation of color images. In this section, we propose an alternative weighted histogram specification (HS) [4] method for saturation improvement. HS aims to transform an input image into the output image whose histogram fits a specified target one. The proposed HS method computes the target histogram from an input color image using the saturation values. In the proposed gamut mapping method described in Section 3, the modified color p ′′′ of p is located on line segments joining the points 0 and x p (y p ) or the points x p (y p ) and 1. The closer p ′′′ is to the corresponding plane, in Fig. 1, with the unit normal vector u i p , the higher saturation it has. Based on this observation, we calculate a target histogram by voting the saturation values of the colors on the line segments to the histogram initialized to 0, and use the obtained target histogram in HS. That is, each vote to the histogram is weighted by the saturation value. The detailed procedure for computing the saturation-weighted target histogram is as follows.
Let P be an input RGB color image, and let h = [h 0 , . . . , h k , . . . , h K ] be a target histogram initialized by h k = 0 for k = 0, . . . , K, e.g., K = 255 × 3 = 765 if P is a 24-bit color image. Then, for every pixel p ∈ P, we do the following procedure: i) If u T i p p ≤ θ, then we compute the intersection x p of the extension of p and the plane u T i p p 0 = θ. Let ϕ x be the orthogonal projection of x p onto the intensity axis joining 'K' and 'W' in Fig. 1 as Then, for k = 0, . . . , K, we take either step i-1) or i-2) followed by i-3) as follows: i-1) If √ 3k/K ≤ ϕ x where √ 3k/K = ∥k1/K∥ for a point k1/K on the intensity axis, then we compute a point r = ρ r p whose orthogonal projection onto the intensity axis coincides with √ 3k/K, i.e., from 1 √ 3 1 T r = ρ r l/ √ 3 = √ 3k/K, we have ρ r = 3k/(Kl). i-2) If √ 3k/K > ϕ x , then we compute a point r = ρ r 1 + (1 − ρ r )x p whose orthogonal projection onto the intensity axis coincides with √ 3k/K, i.e., from 1 We vote the saturation of r to h k as h k ← h k + S (r). ii) If u T i p p > θ, then we compute the intersection y p of the plane u T i p p 0 = θ and the line passing through p and 1. Let ϕ y be the orthogonal projection of y p onto the intensity axis as ϕ y = 1 . Then, for k = 0, . . . , K, we take either step ii-1) or ii-2) followed by ii-3) as follows: ii-1) If √ 3k/K ≤ ϕ y , then we compute a point s = ρ s p whose orthogonal projection onto the intensity axis coincides with √ 3k/K, i.e., from 1 ii-2) If √ 3k/K > ϕ y , then we compute a point s = ρ s 1 + (1 − ρ s ) p whose orthogonal projection onto the intensity axis coincides with √ 3k/K, i.e., from 1 The pseudocode for computing the saturation-weighted target histogram is shown in Algorithm 4.
By the above procedure, we obtain the saturationweighted target histogram h for HS, which provides an intensity transformation function for f (l) used in the proposed gamut mapping method described in Section 3.

Experimental Results
In this section, we show experimental results of hue-preserving gamut mapping on real color images, and compare the proposed method with Naik's method [1] and Yang's method [3]. Figure 2 shows the gamut mapping results, where Fig. 2(a) shows three original images: Couple (underexposed), House (moderately exposed) and Tiffany (overexposed) arranged from left to right. Figures 2(b) and (c) show the results by Naik's method and Yang's one, where histogram equalization (HE) is used for the intensity transformation f (l). Naik's method decreases the saturation compared with the original images in Fig. 2(a) as shown in Fig. 2(b), whose images become similar to their grayscale ones. Yang's method alleviates the decrease in saturation compared with Naik's results as shown in Fig. 2(c). Figures 2(d) and (e) show the results by the proposed methods with HE and saturation-weighted histogram specification (SWHS) described in Section 4, respectively. The images in Fig. 2(d) are more colorful than that in Fig. 2(c), which demonstrates the saturation improvement in the proposed gamut mapping method described in Section 3 compared with Yang's method. The proposed method with SWHS further improves the saturation as shown in Fig. 2(e), which demonstrates the effectiveness of the proposed SWHS method described in Section 4. Compute the intensity of p as l = p 1 + p 2 + p 3 ;

6:
Compute i p = arg median i∈{1,2,3} (p i ); 7: if u T ip p ≤ θ then 10: x p := p/(p ia + p i b ); 11: 12: for k := 0 to K do   Figure 4 shows the mean saturation values per pixel of the images in Fig. 3. The vertical and horizontal axes denote mean saturation and images, respectively. The colors of bars denote the compared methods, i.e., cyan, green, yellow, orange and red denote the original image, Naik's results, Yang's results and the results of the proposed methods with HE and SWHS, respectively. This figure shows graphically and numerically that Naik's method (green bar) decreases the mean saturation from the original images (cyan bar), Yang's method (yellow bar) gives higher saturation than Naik's method, and the proposed methods (orange and red bars) boost up the mean saturation values further than Yang's method.

Conclusion
In this paper, we proposed a hue-preserving gamut mapping method which improves the saturation of color images more than recently proposed related methods. We also proposed a histogram specification method with a saturation-weighted target histogram, and combined it with the proposed gamut mapping method to boost up the saturation. Experimental results showed that the proposed methods can improve the saturation of color images better than the compared methods.