Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-10-12 01:51:31

"Sebastian Redl" <sebastian.redl_at_[hidden]> wrote in message
> Andy Little wrote:
>> One could start from the most comprehensive model , which is probably that
>> closest
>> to the physical phenomenon of electromagnetic radiation
> The physical/neurological phenomenon of perceived colour is very
> complicated. It involves a range of electromagnetic radiation and the
> way the retina cells are stimulated by it, and it is not really useful
> in computer graphics. For example, the colour orange may be perceived
> either by stimulation by the orange frequency (wavelengths from 590 to
> 620 nanometers), or it may be stimulation by two or more distinct
> frequencies ranging from the green to the red area. In real life, it
> will usually be a continuous spectrum, distributed in such a way that
> the red receivers are stimulated more than the green receivers.
> In fact, the exact way by which the human eye perceives colour is not
> yet definitely known.

Nevertheless whether you are a physicist or a theatre lighting designer or an
artist, there seems to me to be a common and limited set of operations on

For theatre lighting (and for lighting a 3d CGI scene) one uses lights with
colour filters and mixes colours. Lights can be dimmed or brightened or switched
on and off.

These are quite simple operations and seem to me to apply to most models of

The other aspect of colour ( but not being an expert) is that it seems to be
like a 3d vector in many respects, where instead of x,y,z you have the colours
red, green and blue.( as I saw on a Wiki somewhere). This gives you a basis
for some mathematical operations, like addition, subtraction and multiplication
by a scalar. That is assuming the RGB model, but the RGB model appears to be the
closest hardware conterpart to the physical phenomena.

This stuff is presumably pretty basic to an expert, but my point is that a
colour C++ Concept is not outside the realms of possibility AFAICS. To me anyway
its more interesting and useful on its own, and should be useable on its own.

>> and why there are various representations.
> That could certainly be interesting, but it might also be too much
> theory for the library. I think the presence or absence of such
> background documentation should not affect the decision whether to
> accept or reject GIL.
>> For instance the primary colours are red, yellow and blue.
> No, they're not. It's what people learn when they grow up, but it's
> really wrong.
> The primary colours of the additive model are red, green and blue. With
> three light sources in these colours, you can mix nearly every other
> colour a human can perceive. Because the human eye responds to these
> three colours the strongest, they most closely resemble the real model.
> Mixing these three colours results in white, while the absence of them
> is black.
> The primary colours of the subtractive model are magenta, cyan and
> yellow. Absence of these is white, presence of all three is white. They
> are used in printing, because the base of printing is a white ground,
> and because printed colour dots don't emit light, unlike CRT/LCD pixels.
>> Floating point RGB colours often have a range of intensities per color
>> between 0 and 1, yet if
>> I look at the sun I can burn my eyes. IOW what do those numbers actually
>> represent in terms of the physical phenomenon of light.
> Ah, that's an interesting question. In terms of the physical phenomenon,
> the answer is, "not much". The answer is found in engineering: 0 means
> nothing, while 1 means the brightest light the output device is capable
> of emitting (under its current brightness configuration).

That doesnt give you much of a basis for comparing two images from different
sources. Say for comparing a CCTV image of a criminal to a mugshot. Presumably
there are standards around which try to address this problem.

>> IOW surely the goal is to try to model the physical phenomenon in the best
>> possible way given a set of constraints imposed by hardware and software.
> What do you mean now, the goal of the library or the goal of computer
> engineering?
> In terms of computer engineering, well, they actually achieved the
> physical model ;)

They may do if they have a standard by which the hardware phenomenon is
calibrated to the physical one as in the above problem.

> In terms of the library, I disagree. The library should model not the
> physical concept of colour, because that is tricky to define, hard to
> understand, and complicated to work with.

That is up to the designer of the Concept. The phenomenon may be complex but the
means of using it, its operations, seem fairly simple to me.

A library doing that might be
> nice for exact scientific simulation, but useless in every other
> discipline concerned with colour.
> Rather, the library should most closely model colour as it is used in
> computing, i.e. be capable of representing the various colour models in
> use (RGB, CMYK, HSV, ...) and providing access to all these, while
> allowing transparent use in cases where I don't care about them,
> allowing conversion between the various models, etc.

And don't forget printing...

And thanks for the technical info about colour which was very interesting.

Andy Little

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