Grayscale Image Coloring by Using Ycbcr and HSV Color Spaces
Grayscale Image Coloring by Using Ycbcr and HSV Color Spaces
DOI:10.21884/IJMTER.2017.4130.XD635 130
International Journal of Modern Trends in Engineering and Research (IJMTER)
Volume 04, Issue 4, [April– 2017] ISSN (Online):2349–9745; ISSN (Print):2393-8161
compare luminance value of each pixel window form target image with all pixel window of source
image , depending on minimum Euclidean distance color component of color source image are
transferred to grayscale image pixel window found and used for colorization of respective pixel window
from input grayscale image[6].
II. COLOR SPACE
2.1 RGB color space (Standard)
The RGB model is represented by a 3-dimensional cube with red green and blue at the corners
on each axis (Figure 1). Black is at the origin. White is at the opposite end of the cube. The gray scale
follows the line from black to white. In a 24-bit color graphics system with 8 bits per color channel, red
is (255, 0, and 0). On the color cube, it is (1,0,0) [7].
The RGB model simplifies the design of computer graphics systems but it is not ideal for all
applications that red, green, and blue color components are highly correlated. This makes it difficult to
execute some image processing algorithms. Many processing techniques, such as histogram
equalization, work on the intensity component of an image only. These processes are easier
implemented using the HIS or YIQ color models [8]
Where:
R, G, B: Red, Green and blue Channels
Y, Cb, Cr: Channels of YCbCr color space
The inverse transform equations are
R= Y + (Cb-128) + (Cr-128) ----------------------------(4)
G= Y-0.343*(Cb-128) – 0.711*(Cr-128) --------------(5)
B= Y + 1.765*(Cr-128) --------------------------------(6)
2.3 HSV COLOR SPACE
HSV is stands for (Hue, Saturation Value/Brightness). This color space is three dimensions put together gives
a volume shaped like a cone, Figure (2) illustrate the cone shape of the HSV color space, this color space has the
following characteristic [7]
The hue (H) of a color refers to which pure color it resembles. All tints, tones and shades of red have the
same hue [11].
The saturation (S) of a color describes how white the color is. A pure red is fully saturated, with a
saturation of 1; tints of red have saturations less than 1; and white has a saturation of 0 [11].
The value (V) of a color, also called its lightness, describes how dark the color is. A value of 0 is black,
with increasing lightness moving away from black [11].
F. Transfer the (Cb) and (Cr) channels from the best matching pixels window (source color image ) to
the first pixel window of target grayscale image and keep the (Y) channel of target grayscale image
unchanged.
G. Repeat steps D, E, F above for all pixels windows of target grayscale image.
H. Transfer the result image from YCbcr color space to RGB color space.
IV. QUALTY OF RESULT COLOR IMAGE
Quality of greyscale image colorization technique is subjective to the source color image
selected for coloring and also to the greyscale image to be colored. There are no objective criteria to
check the performance of colorization method. At most one may take a source greyscale of source
colorimage and try to recolor it using the colors from source color image. Then calculate the Mean
Squared Error (MSE) and peak signal to noise ratio (PSNR) between the result image and original image
could be considered serve as performance measure to see the quality of colorization method.
V. RESULT AND DISCUSSION
The grayscale coloring algorithm design using Visual Basic.net 2013 as programming language.
Our program building in personal computer has 64- bit operation system ( Microsoft Window 8.1) with
8 GB RAM and processor type Intel core ™ i7- 5500 2.4Ghz and VGA card type NVIDIA GeForce
920M.
The quality of output of colorization algorithm is subjective to the type of source color image
used to generate color palette and the target (to be colored) grayscale image. For test the performance of
the coloring proposed algorithm we used four grayscale test images as shown in Figure (3,4,5,6) are
recolored by using our coloring algorithm through (9 pixel window size) start from (2 x 2) up to (10 x
10) with calculation of mean square error (MSE) and peak signal to noise ratio (PSNR)
Figure (4):-coloring test image #2 (natural view with great well image
below Figure (7) show the Mean Squared Error (MSE) difference between the original image
and respective re-colored image by our proposed coloring algorithm for the all test images using various
pixel window sizes, It observed that the pixel window give less MSE reflecting better coloring result
compared to the other pixel window size, as for Peak Signal to noise Ratio (PSNR) greater value
reflecting better coloring result compared with the other pixel window size see (Figure 8).
400
350
300
250
MS value
200
150
100
50
0
2x2 3x3 4x4 5x5 6x6 7x7 8x8 9x9 10 x 10
Pixel Window
[4] Muhammed Imran, "Coloring gray scale image", Dec 2012, HÖGSKOLAN Dalarna.
[5] Andre Gagalowics , Wilfried Philips , Computer Analysis of Images and Patterns , 11th International , France ,
September 2005 , Springer.
[6] H B Kekre , Tanuja Sarode , Sudeep D. Thepade , Supriya Kamoji , Performance Analysis of Various Window Sizes for
Colorization of Grayscale Images using LBG and KFCG Vector Quantization Codebooks in RGB and Kekres LUV
Color Spaces , International Journal of Soft Computing and Engineering (IJSCE), ISSN: 2231-2307, Volume-1, Issue-4,
September 2011
[7] Noura abd EL-Moez AL Sebaey Semary , “Gray Image Coloring Using Texture Similarity Measure “,University of
Monofiya ,2007.
[8] Jacques Paris, web site, “Color Models for MapInfo,” April 2002 in URL, http://www.paris-pc-
gis.com/MI_Enviro/Colors/color_models.htm
[9] Web site;- https://www.researchgate.net/figure/223162168_fig5_Fig-6-The-eight-corners-of-RGB-cube
[10] Rujuta R Mahambare , " Converting Gray-Scale image to color image " International Journal of Computer, Information
Technology & Bioinformatics (IJCITB). ISSN: 2278-7593, Volume-1, Issue-4
[11] Web site http://infohost.nmt.edu/tcc/help/pubs/colortheory/web/hsv.html