Login  Register

Re: CIELab Color Averaging

Posted by dscho on Oct 29, 2014; 10:42am
URL: http://imagej.273.s1.nabble.com/CIELab-Color-Averaging-tp5010215p5010220.html

Hi Albatross,

On Tue, 28 Oct 2014, Albatross wrote:

> Was wondering if anyone could explain how the "Average Color" function in
> ImageJ/Fiji works (i.e., how is it averaging color)?  What is the function
> doing when "CIELab Averaging" is checked?

To understand what colors really are, you will need to study color space
theory.

I found a very interesting read some time ago:
http://www.4p8.com/eric.brasseur/gamma.html

Please note that ImageJ does not exactly make a difference between
spectrographs and photographs (and displays spectrographs as if they were
photographs), therefore you will experience exactly the problem described
in the linked article.

Further, I should state right away that there is *no* perfect color space.
Even CIELab is not perfect, while it was designed to reflect human color
perception as well as possible (read: perceptional differences in color
were intended to be reflected very closely in the geometric distance of
the corresponding (L,A,B) coordinates). And I should also stress that
there are actually *two* Lab spaces: Hunter Lab and CIE L*a*b. They are
slightly different, and to this day psychologist disagree which one is
more appropriate.

To make things even more complicated, the (Lab) color spaces require the
specification of a white point, too.

If you truly need to work with colors scientifically, you really need to
know a lot about color theory including color spaces. In particular, you
need a calibrated camera, a calibrated screen and you need to verify
constantly that everything keeps being calibrated.

As a quick starter, I suggest https://en.wikipedia.org/wiki/Color_space
and https://en.wikipedia.org/wiki/Lab_color_space, but this is just the
first step.

Once you understand just how much of a Pandora Box you just stepped into:
The "average color" plugin assumes quite a lot: it assumes that your
images are in sRGB and by necessity it will have rounding issues (as the
result is moved back into integer sRGB values). And if the CIELab checkbox
is unchecked, the averaging makes no sense perceptually, only
arithmetically. In other words, the "average color" plugin is more a toy
than a finished scientific tool (I never had a need to make it more
scientifically rigid as I stopped working on the perception of colors
pretty much exactly when I started working on Fiji).

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html