[GEM-dev] Re: meanwhile, in gempixutil...

Mathieu Bouchard matju at sympatico.ca
Tue Feb 22 18:40:23 CET 2005


On Tue, 22 Feb 2005, IOhannes m zmoelnig wrote:

> if i understand your question correctly, the colors are not as they
> should be (or rather: most of the colors are fine, but some are
> clipping) this is true and known (and bad, btw) the problem is (i
> believe), that YUV does not use the whole range from 0..255 but
> something like 16..245 (or whatever: i didn't write it down and now i
> cannot find it); i didn't add any clipping for this (which was very
> stupid) because of performance reasons.

I use a slightly different formula for YUV. Someone has told me that I
should use the 7/8 range (16..239 instead of 0..255) but I never really
was convinced, especially because I always get my data from sources that
already have various contrasts and brightnesses, so much that the
difference between both is not significant, in that I would have to tune
things anyway!

What really kept me on the 0..255 side is that then the Y part is exactly
as recommended in RGB-to-greyscale conversions, so that YUV is a true
extension of the greyscale used everyday along with RGB. I think that
doing it this way captures the essence of YUV while rejecting apparently
silly variations that may have happened for historical reasons (!).

Even when using 0..255, though, you *can* (and prolly will) get
out-of-gamut values. They're very easy to do. Start with black (which is
either 0,0,0 or 0,128,128 depending on the variant). Most of the points
that are around that, are colours that have negative values in
RGB! Because where the RGB colorcube has its black vertex, YUV has the
middle of a face! And the same happens with RGB's white vertex!

It can depend a lot on what other colourmodel it came from, which sensors,
and which formulas were used in correcting. I know that in PhotoShop it
was real easy to come up with impossibly cyan/teal colours on the screen,
and then have them print correctly on paper such that you can see that,
really, those colours don't exist on standard CRT monitors.

BTW, anyone know about the following mystery? LCD and Plasma screens have
a larger gamut: the primary colours are purer, so there are more possible
combinations than the tainted colours of a CRT. Now, why is it that I
never seem to hear about converting from CRT-RGB to LCD-RGB and back ?
Because it seems to me that this difference is a lot more visible than,
say, the 7/8 contrast ratio mentioned above.

And who cares about all of that anyway when we don't even seem to bother
to set our gamma corrections properly! ;-)

_____________________________________________________________________
Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju





More information about the GEM-dev mailing list