ISSN: 2229-371X
Debasish Biswas*1, Amitava Nag1, Soumadip Ghosh1, Arindrajit Pal1, Sushanta Biswas2, Snehasish Banerjee1, Anjan Pal1
|
Corresponding Author: Debasish Biswas, E-mail: 1debaindia@rediffmail.com |
Related article at Pubmed, Scholar Google |
Visit for more related articles at Journal of Global Research in Computer Sciences
Color photography was originally rare and expensive, and color images became more popular only in the middle of the 20th century. It has indeed become even more popular since yet black-and-white remains a niche market for people who use the medium for artistic purposes. Even in today’s modern era, there is importance of grayscale and black-and-white images. Since the advent of color, black-and-white connotes something nostalgic, historic and anachronistic. There are three basic and primitive techniques to convert a color image into its gray level equivalent - the lightness method, the average method and the luminosity method. Here, we propose some novel approaches of converting a color image into grayscale image, based on varying pixel depth.
Keywords |
Grayscale image, Binary image, Pixel depth. |
INTRODUCTION |
A grayscale digital image is an image in which the value of each pixel is a single sample, that is, it carries only intensity information but no chromatic information. They are composed exclusively of shades of gray varying from black as the weakest intensity to white as the strongest. These images are also known as black and white images. It is to be noted however that the term black-and-white as a description is something of a misnomer because in addition to black and white, they consist of varying shades of gray. Grayscale images are distinct from one-bit black-and-white images, which in the context of computer imaging are images with only the two colors, black, and white (also called bi-level or binary images). So, single bit black-andwhite images are called binary images. Essentially, standard grayscale images are actually eight bit black-and-white images such that for each pixel, there is a set of 28 permissible values. Due to this, grayscale images have many shades of gray in between. The reason for differentiating these images from any other sort of color images is that less information needs to be provided for each pixel. Gray color is one in which all the red, green and blue components have equal intensities. So, it is necessary to specify only a single intensity value for each pixel. |
The intensity of a pixel is expressed within the given domain of 28 values between a minimum and a maximum, inclusive. This range can be represented in any abstract way as a range from 0 (total absence, black) and 1 (total presence, white), with any fractional values in between. The darkest possible shade is black, which is the total absence of transmitted or reflected light. The lightest possible shade is white, the total transmission or reflection of light at all visible wavelengths. Intermediate shades of gray are represented by equal brightness levels of the three primary colors (red, green and blue) for transmitted light, or equal amounts of the three primary pigments (cyan, magenta and yellow) for reflected light. |
computer display), the brightness levels of the red (R), green (G) and blue (B) components are each represented as a number from decimal 0 to 255, or binary 00000000 to 11111111. For every pixel in a red-green-blue ( RGB ) grayscale image, R = G = B. The lightness of the gray is directly proportional to the number representing the brightness levels of the primary colors. Black is represented by R = G = B = 0 (in decimal representation) or R = G = B = 00000000 (in binary representation), and white is represented by R = G = B = 255 (in decimal representation) or R = G = B = 11111111 (in binary representation). Because, there are eight bits in the binary representation of the gray level, this imaging method is called 8-bit grayscale. In the case of reflected light (for example, in a printed image), the levels of cyan (C), magenta (M), and yellow (Y) for each pixel are represented as a percentage from 0 to 100. For each pixel in a cyan-magenta-yellow (CMY) grayscale image, all three primary pigments are present in equal amounts. |
Grayscale images are also called monochromatic, denoting the absence of any chromatic variation (i.e.: no color). Grayscale images are often the result of measuring the intensity of light at each pixel in a single band of the electromagnetic spectrum (e.g. infrared, visible light, ultraviolet, etc.), and in such cases they are monochromatic proper when only a given frequency is captured. |
GRAYSCALE CONVERSION |
Conversion of a color image to grayscale is not unique. Different weighting of the color channels can effectively represent the effect of shooting black-and-white film with different-colored photographic filters on the cameras. A common strategy is to match the luminance of the grayscale image to the luminance of the color image. |
To convert any color to a grayscale representation of its luminance, first one must obtain the values of its red, green, and blue (RGB) primaries in linear intensity encoding, by gamma expansion. Then, a certain percentage of the RGB values are added together. The weights depend on the exact choice of the RGB primaries, but are never fixed. Regardless of the scale employed (0.0 to 1.0, 0 to 255, 0% to 100%, etc.), the resultant number is the desired linear luminance value. |
There are three basic strategies to convert a color image to a grayscale image; namely the lightness method, average method and luminosity method. Let us assume that R, G and B are the value of a pixel’s Red, Green and Blue components respectively when the image is represented in ARGB model. Also let GY denote the resulting gray level for that pixel. |
The lightness method averages the most prominent and the least prominent colors. So, GY = (max(R, G, B) + min(R, G, B))/2 |
The average method simply averages the values. So, |
GY = (R + G + B)/3 |
The luminosity method is more sophisticated approach. It also averages the values but it forms a weighted average to account for human perception. Human eyes are more sensitive to green than other colors, so green is weighted most heavily in this approach. Colors in an image can be converted to a shade of gray by calculating the effective brightness or luminance of the color and then using this value to create a shade of gray that matches the desired brightness. So, |
GY = 0.56 G + 0.33 R + 0.11 B |
The lightness method generally tends to reduce the contrast of the resulting image. But for some images, the three algorithms produce very similar results. |
OUR PROPOSED SCHEMES |
Our algorithm constructs the gray-level equivalent of a color image based on varying pixel depth. In computer graphics, the term pixel depth or color depth or bit depth is defined as the number of bits used to represent the color of a single pixel. The concept is also known as bits per pixel (bpp). Here, we just try to vary the pixel depth and produce different types of grayscale images. |
3-BIT GRAY SCALE CONVERSION |
Now we can also convert this standard 8 bit grayscale image to a 3 bit grayscale image. A 3 bit grayscale image will have 23 = 8 intensity levels. Now we have to map the 255 intensity levels to those 8 intensity levels. We can perform this operation in various ways. |
First Approach |
Here, every ith intensity is mapped to { i / ( MAX_INTENSITY / 8 ) }th value . The diagram shows the mapping of the intensity values: |
Second Approach |
Here, every ith intensity is mapped to [{ i / (MAX_INTENSITY/8)} x (MAX_INTENSITY/7)]th value The diagram shows the mapping of the intensity values: |
Similarly any image can be converted to a 4 bit or 5 bit grayscale image based on these equations |
[ { i / ( MAX_INTENSITY / 2no of bits ) } x ( MAX_INTENSITY / ( 2no of bits – 1) ) ] th value . where i is the ith intensity of ith pixel. |
Third Approach |
Here, every ith intensity is mapped to user defined range Range that means every ith intensity is mapped to |
where R is the Range. |
The following cases show the different values of Range(R) that a user can give according to the choice. Case 1 : No. of bits = 3 and Range=20 |
Figure 10 : (a) Original image; (b) Output image for no. of bits = 4 and Range = 16. |
3-BIT RED GRAY SCALE EXPANSION |
An image can be converted to 3-bit red grayscale image where the red layer only contains the intensity information rather than all other layers. The algorithm first takes an input image, then process each of its pixel values r g b, calculate its gray level value and then set each b and g part to zero. |
3-BIT GREEN GRAY SCALE EXPANSION |
An image can be converted to 3-bit green grayscale image where the green layer only contains the intensity information rather than all other layers. The algorithm first takes an input image, then process each of its pixel values r g b, calculate its gray level value and then set each r and b part to zero. |
3-BIT BLUE GRAY SCALE EXPANSION |
Similarly, an image can be converted to 3-bit blue grayscale image where the blue layer only contains the intensity information rather than all other layers. |
CONCLUSION |
The conversion of an image to a lower bit grayscale does not require an encoding technique; however the basic conversions are only displayed. Users can encode the images to their preferred encoding technique. However, it is quite obvious that smaller the number of bits used, the image quality will be degraded. But the world of images is colossal and it is worth trying to devise grayscale images for which minimum information is required to store them yet there is imperceptible degradation in the quality of the image. |
References |
|