Login  Register

Re: Grayscale to RGB conversion

Posted by Michael Miller on Dec 06, 2006; 5:20pm
URL: http://imagej.273.s1.nabble.com/Grayscale-to-RGB-conversion-tp3700873p3700875.html

Hi,

What people are trying to say is, you can't do this unless you add more
information. You can't just run an operation and get the color back.

RGB stands for Red-Green-Blue, each channel is 8 bits. RGB is 24 bit color.

Greyscale is one 8 bit channel of intensity.

When you go RGB -> Greyscale you lose 1/3 of the information of the image.
Algorithms decide based on the different intensities of the red, green, and
blue channels what color to make each pixel. I'm sure there are several
papers and open source algorithms on this subject.

Going from Greyscale to RGB and getting color back, there's too much
nullspace. You need to introduce more information into the image, because
you've lost so much already. From a purely 8bit to 24bit perspective, there
are literally 2^16 more possibilities for each pixel; although I imagine
that number is sharply reduced because the available intensities have to
also satisfy whatever the algorithm chose RGB->Greyscale (as you are forming
a bijection at this point).

As others have already stated, no known algorithm exists in ImageJ at this
time.

One way that you can introduce more info, edit the LUT. You can experiment
with that in the Image -> Color menu. I believe you can use it to assign
each greyscale value as an index to a 24 bit color, allowing you to select
up to a maximum of 256 different colors for your greyscale image.

Good luck,
-Mike

----- Original Message -----
From: "sharmistha paul" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, December 06, 2006 7:16 AM
Subject: Re: Grayscale to RGB conversion


Thanks.
I did as you said.
It's transform the image f
Hi Claude,

Thanks.
I did as you said.
It's transform the image from grayscale to RGB color. But it shows black and
white image. I really need  the command for transforming the color image
from my black and white (gray scale) picture.

I hope somebody help me to overcome the problem.

Sharmistha


----- Original Message ----
From: Claude Bonnard <[hidden email]>
To: sharmistha paul <[hidden email]>
Sent: Wednesday, December 6, 2006 11:25:41 AM
Subject: Re: Grayscale to RGB conversion


Hello Paul,

The simplestshould be  to go to  Image>color>RGB Merge and to use the same
image for every color! You will of course triple the size of your image ,
and
you need a 8 bit image to start with

Hope it helps
Regards,
Claude

--
Claude Bonnard Ph.D.
ISREC (Swiss Institute for Experimental Cancer Research)
Microscopy, Imaging and Morphology Core Facility [MIM]
Lab F216
Ch des Boveresses 155
CH-1066 Epalinges
Switzerland
email: [hidden email]
phone: [41-21]-692-5891
  fax: [41-21]-652-6933



____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index