Boost logo

Boost :

From: Geoffrey Romer (geoff.romer_at_[hidden])
Date: 2005-09-27 17:57:21

> > Off the top of my head, I can think of two ways of implementing this.
> > One would be to choose a single color space as canonical, and define
> > all generic operations in terms of that space. Then, each new color
> > space just needs to define conversion operations. This has several
> > drawbacks, most obviously the problem of performance (conversion might
> > not be cheap). In addition, there may be subtle correctness issues
> > associated with the convert-compute-convert model. Finally, this would
> > restrict the system to perceptual (as opposed to physical) color
> > models, so that (for example) spectral color models would be
> > disallowed (this is because the canonical model would have to be a
> > perceptual model for performance reasons, and conversion from physical
> > to perceptual color is an information-losing operation)
> >
> Interesting. Actually, now that I think about it, not very many
> representations are even perceptual (ie. have a colour profile
> associated with them, and thus a single real-world colour to map to.)
> I would therefore have to say, use the ICC Lxy (? the 'tongue' shaped
> one) physical colourspace as the canonical, require all colours to be a
> part of a colourspace (ie: sRGB<rbg_color<int> >. uggh. Defaults? Common
> types?) and simply declare gamut conversions expensive. (They are
> already lossy, so noone should be trying to do this a lot)
> There is actually room for optimisation here, most gamut conversions
> will be on large amounts of different colours at once with a single
> conversion, therefore some sort of palleted conversion could be
> possible. I'm not an expert here, so take all this with a grain of salt.

I meant "perceptual" in a more general sense, meaning any color space
which is designed to represent perceptually distinct colors.
Essentially all commonly-used color spaces fit that criterion, because
they're all based (in one way or another) around the trichromatic
generalization, which is a perceptual phenomenon. A "physical" color
space would be one designed to represent all physically distinct
colors, i.e. all colors with distinct spectra (typically by sampling,
since physical colors contain a theoretically near-infinite amount of
information). RGB is unique in that it does double duty as a
representation of perceptual colors and as a (very poor)
representation of physical spectra.

I was thinking CIE XYZ would be a sensible choice of a 'canonical'
color space, because it's so common and well-understood (color gamuts
are usually depicted as polygons in a slice of XYZ), and it has nice
features like having all real colors in the +X +Y +Z octant. Wikipedia
tells me that CIE Lab is usually considered the "standard" color
space, so that might also be a good choice, except that it's expensive
to convert to spaces like RGB because it's been distorted in order to
be "perceptually uniform". Lab is defined in terms of XYZ, so XYZ
seems like a sensible next-best, and conversion between XYZ and RGB is
a linear transform (i.e. about as cheap as it gets). I'm having
trouble finding references on Lxy, so I can't really comment on how
good a choice it would be, but I've come across references to it that
suggest it's a relative of Lab.

Boost list run by bdawes at, gregod at, cpdaniel at, john at