Solved

How can I turn a black and white picture into a colorful one?

Posted on 2001-07-18
7
269 Views
Last Modified: 2010-04-06
Hi,dear experts:
    I know how to turn a colorful picture into a black and white one.For example:pixel.r:=(pixel.r+pixel.g+pixel.b)/3;and pixel.g:=pixel.r;pixel.b:=pixel.r;right?
      But for a opposite transformation,what shall I do?
     How can I turn a black and whithe picture into a colorful one?Thank you for your kind answere.I will appreciate them very much.
 
   
0
Comment
Question by:feixiangniao
7 Comments
 
LVL 4

Accepted Solution

by:
StevenB earned 200 total points
Comment Utility
 In terms of pure graphics programming this cannot be done, there is no way of establishing the correct colour of a greyscale pixel.

  If you ware to seed the greyscale image with some colours then you could write an inteligent tinting algorhythm that searched for image element borders and coloured the image appropriately, but this would be a massive task.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
take a look to

http://www.efg2.com/Lab/Graphics/index.html

i guess you may find there many tips

meikl ;-)
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
Just let's do some math:

If you have 3 numbers like e.g. 250, 200 and 150. Now you calculate (250 + 200 + 150) / 3 = 200. So now the result is 200.

How would you go backwards? How can we (or a program) know that 200 should be resolved to 250, 200 and 150? It's simply impossible mathematical. When doing the (r+g+b)/3 we're losing information that we can't recover.

Regards, Madshi.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 4

Expert Comment

by:StevenB
Comment Utility
 If you already have the colour image and have converted it to greyscale for display purposes, then you could cache the colour version in order to reverse the operation.
0
 
LVL 33

Expert Comment

by:Slick812
Comment Utility
If you had a black and white image of me, and wanted to make it "colorful" , would you know what color to make my shirt ? How would a program know what color to make my shirt, pants, hair, ect?. . so the opposite transformation of a grayscale image requires the "color" information for that image. . . and by the way, the formula used for getting B&W TV is (0.30 * Red) + (0.59 * Green) + (0.11 * Blue) which gives a truer grayscale image
0
 
LVL 26

Expert Comment

by:Russell Libby
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept StevenB's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now