May 27, 2004

Lab Contents

RGB TIFF

Tree Example

 

This is a 24 bit TIFF image - three 8 bit gray level images all in one file - one gray level image each for Red, Green and Blue. (The color image is shown in a window called Indexed Color. The original red, green and blue slices are shown in a window behind this window, as a stack. Use the stack menu to view the three slices, ie. the red, green and blue components of the image.)

In ImageJ, this image is opened as an RGB image.  You can change it into an 8-bit indexed color image using Image / Type / 8-bit color, and selecting 256 colors.  I think that the quality of the 8-bit approximate to the original is as good as that of the Photoshop approximate shown below.

For comparison with the two images to follow, here is the upper left part of the image Adobe Photoshop, a program made to display 24 bit color images.

 JPEG from Photoshop. 24 bit color.

(The JPEG image appears in the Web Browser. It is not printed in the hard copy.)

 JPEG image appears in browser

 

 GIF from Photoshop. Quality is about the same as the 24 bit color JPEG. The indexed color scheme is the best of these three.  

   The 24 bit color tree.tiff file is loaded into Image as a three image stack, and then the Stacks->RGB to 8-bit Color menu is called automatically. The result is an 8-bit indexed color image. For images such as this, the results are best using the 'Custom' palette. The indexing schemes are different from each other and from the scheme used in Photoshop (above.)
 Mac version.  

PC Version, Scion 1.61: when this image is redrawn, the color scheme is somehow damaged. The only fix I know of is to show the RGB stack (appears as a gray level image) and use the RGB to 8-bit Color menu again.

Scion Beta 3b, NT 4.0, redraws the window properly.

 ImageJ:  To see the LUT for the 8-bit color version:

  • Make a ramp using File/New
    • type 8-bit
    • size - 450 x 50 pixels
    • fill with:  ramp
  • Convert the tree image to 8-bit color
    • click on tree image to make it the front or "active" window.
    • Image / Type / 8-bit color, 256 colors.
  • Copy and paste the ramp image into the tree image.  Position as desired.
 

 

The LUT window has changed from a gray level or color ramp to what appears to be arbitrarily chosen colors. These colors are the 256 colors that the indexing algorithm thought best matched the thousands of colors in the image. When the cursor is moved over the LUT window, the RGB components are shown: - here are the RGB components for pixel value 255. . ImageJ:  when the cursor is moved over the image, the RGB components and, if it is an 8-bit color image rather than an RGB image, the index appear in the status bar (in the ImageJ window under the tools).

(Note that levels 0 and 255 have been assigned colors other than black and white - this is a special case, and that although you can appear to edit these values, the result doesn't seem to affect the image until the Process->Fix Colors is invoked. Not applicable to ImageJ).

Note - the Process -> Convert to Grayscale menu (ImageJ:  Image / Type / 8-bit) will convert this color image to a reasonable grayscale image. (This menu replaces the Apply LUT menu when the front image is a false color image.) The quality of the resulting grayscale image is inferior to the quality of the original gray level images due to the dithering used to make the 8-bit color image more like the 24 bit color image original.

   
 Portion of the grayscale 'equivalent' to the color image, made with the Convert to Grayscale menu. Note the little dots in the darker regions (green arrow). (The number of gray levels is less than 100.)  Grayscale image for the green channel. There are no such dots. (The number of gray levels is 256. This was not determined using NIH Image, but with Photoshop while converting the image to a .gif file.)

Note that Process -> Find Edges and other processing operations give meaningless results on the Indexed Color image, because the pixel values are assigned arbitrarily as far as gray level is concerned. The results do make sense, however, once the image is converted to grayscale. In ImageJ, the processing will not be done on an 8-bit color image.  Processing works on the RGB color image, much as in Photoshop.