Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How To Convert Grayscale Image to Color Image in c#



Thanks in Advanced
Posted

Codeproject's search function can be a great help ;)
Image Transformation: Grayscale to Color[^]

Not to mention Google[^]
 
Share this answer
 
Comments
Uday P.Singh 17-Jan-12 7:25am    
5ed for the link :)
Michel [mjbohn] 17-Jan-12 7:30am    
thanks :)
There is no general solution to this. A greyscale image, by definition, has much less information than the colour image it was created from (one channel instead of three), and that mapping is not reversible (i.e. there is no way to tell whether a grey square started out red, blue or green).

Depending on the domain, you may be able to use a technique like what mjbohn links to (that's a nice article) to map particular grey values to a specific colour, but this relies very heavily on what the image represents, and it's unlikely to be easy to automate the process of picking the colour list.
 
Share this answer
 
Comments
Michel [mjbohn] 17-Jan-12 7:44am    
Good explanation
My 5
Sergey Alexandrovich Kryukov 18-Jan-12 4:34am    
You are right of course, my 5, but "no general solution" is not 100% accurate. The very general solution is possible. It will look like that: a program takes on input 1) gray image, 2) a data file representing arbitrary color map between gray tone space and one of color spaces. Is it general? Yes, quite.
--SA
BobJanova 18-Jan-12 13:54pm    
I wouldn't really count that as a solution, though, because finding the colour map is part of the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900