Solved

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

Posted on 2001-07-18
7
272 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
ID: 6296786
 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
ID: 6296985
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
ID: 6297042
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 4

Expert Comment

by:StevenB
ID: 6297117
 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 34

Expert Comment

by:Slick812
ID: 6300930
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
ID: 8703580
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 112
Dev Express grid collapse 2 45
Reconfigure Delphi Install? 2 60
FMX and jaudiotracker playing memory stream 29 87
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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