[ImageJ-devel] ImageOpener always giving me three channels when these is only one.

Gabriel Landini G.Landini at bham.ac.uk
Mon Dec 13 04:35:05 CST 2010

On Monday 13 December 2010 10:52:34 Johannes Schindelin wrote:
> IMHO an index-color image is _not_ of a numeric type. So to properly
> support index-color images, one would need to make a "CategoricalType"
> that still uses bytes or shorts, but that cannot add/multiply/whatever.

> OTOH if the LUT is just a view mode (as it should always be seen in
> scientific imaging), then the LUT is not part of the image and should not
> be saved in the first place.

I agree here too, but most people will want to save greyscale images with a 
viewing palette while preserving the underlying data.

The problem is how to tell apart a greyscale with a viewing LUT (underlying 
numeric, indexing a palette) from one with an unordered palette (indexed).
One way could be to implicitly record this at creation time (let's say if 
saved as GIF, or after applying some colour reduction) by adding a flag 
indicating so. But of course, all externally created images would not have 
this tag.

But going back to the original problem, if the palette -at file creation time- 
is the Grays.lut, then it should be saved without a palette. I wonder if this 
would solve the reported problem.



More information about the ImageJ-devel mailing list