Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

How can we convert grayscale image to RGB image
Started by AsifJavaid at 11-20-2008 2:23. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  11-20-2008, 2:23
AsifJavaid is not online. Last active: 11/20/2008 7:19:21 AM AsifJavaid

Not Ranked
Joined on 11-20-2008
Posts 1
How can we convert grayscale image to RGB image
Reply Quote
Hi guys,


We can convert an RGB image to Gray scale using the following equation

GrayScaleImage[ ] = 0.299 * red + 0.587 * green + 0.114 * blue
 
We know that in RGB image, we have to play with 3 Matrixes, Red, Green and Blue. But in gray scale image, we have to play with only one matrix. In Matlab 7.0, there are some functions in its image processing toolbox.
1. rgb2gray().
2. gray2rgb().
 
I have made the first function in C#.NET 2005 using the above equation but how can we convert a gray scale image to RGB. Since we know that in the case of rgb2grayscale(), there is some loss of data (3 matrixes to 1 matrix) but in the case of grayscale2rbg(), we have to recover the loss data and make 3 matrixes from 1 matrix of  gray scale image. Sir, how can we achieve this.

Is there any mathematical equation for convert gray scale to RGB.

I think it must be because the 2nd funtion in above( gray2rgb()) of image processing toolbox is already doing this thing in Matlab. Likewise Discrete Cosine Transform its inverse Transform is also exist through which we can recover the original image with few chunks of numeric values.

   Report 
  11-20-2008, 10:14
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,364
Re: How can we convert grayscale image to RGB image
Reply Quote
Although this question is not directly related to any of our products and these forums are meant exclusively for LEADTOOLS customers, I will answer this question for the general benefit.

This is no automatic way to recover color information that gets lost when you convert an image from color to grayscale. You could think of the image as having 2 separate parts. One is the intensity component (grayscale part) and the other is the color component (Hue and Saturation parts).
Converting to grayscale completely destroys both the Hue and Saturation data, and this is a lossy change that cannot be reversed.


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  12-07-2008, 21:24
nithin999 is not online. Last active: 12/8/2008 5:18:46 PM nithin999

Not Ranked
Joined on 12-08-2008
Posts 1
Re: How can we convert grayscale image to RGB image
Reply Quote
hello friend,
                      i think u may be mistaken of a function gray2rgb() in matlab. Am not well versed in matlab. but from a logical point of view its aganist basic law. If u change a rgb to colour all the color information (saturation and hue ) is lost . how u then recreate it. Do u make wav file from mp3. please check once more

   Report 
  12-09-2008, 16:15
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,811
Re: How can we convert grayscale image to RGB image
Reply Quote
I'm sorry, but this doesn't appear to be within the scope of our support.  If you have a question directly related to the use of the LEADTOOLS software, please be more specific and describe the problem you are having.

Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Image Processin... » How can we convert grayscale image to RGB image

Powered by Community Server, by Telligent Systems