Login  Register

Re: 24 bit RGB to 16 bit gray conversion

Posted by Joel Sheffield on Nov 14, 2005; 5:17pm
URL: http://imagej.273.s1.nabble.com/24-bit-RGB-to-16-bit-gray-conversion-tp3704473p3704479.html

Indeed, this is an option for ImageJ.  Check Edit>Options>Conversions
on the ImageJ menu, and search in the list for more discussion of
this topic.  It is also discussed in the Help>Online Docs section on
the Edit menu.  Here are the comments:

Check Scale When Converting to have ImageJ scale from min-max to 0-
255 when converting from 16-bits or 32-bits to 8-bits or to scale
from min-max to 0-65535 when converting from 32-bits to 16-bits.

If Unweighted RGB to Grayscale Conversion is checked, the formula
gray=(red+green+blue)/3 is used to convert RGB images to grayscale.
If this option is not checked, the formula
gray=0.299*red+0.587*green+0.114*blue is used.



> Robert Rohland wrote:
> > Art -
> >
> > Not too difficult. Gray scale is just the average of the red, green,
> > and blue channels.
>
> Robert,
>     That's not quite right.  Gray scale can be computed from
> RGB as the *weighted* average of the RG&B, taking into account
> the sensitivity of the eye's rods and cones to those three
> colors.  Cf.
> http://documents.wolfram.com/applications/digitalimage/FunctionIndex/T
> oGrayLevel.html
>
> HTH,
> -Jeremy


Joel B. Sheffield, Ph.D.
Biology Department, Temple University
1900 North 12th Street
Philadelphia, PA 19122
[hidden email]  
(215) 204 8839, fax (215) 204 0486
http://astro.temple.edu/~jbs