james tittle wrote:
hiya,
...sorry I've drifted away from multiple_windows for a bit, and back to the color conversion stuff...even weirder is the fact that I'm starting with fromYV12, for gem2pdp...anyway, I'm not really understanding your constants in the yv12 to rgb transforms: it certainly doesn't work in the pdp case (I've made a overloaded function accepting short*'s)...however, the following almost works, but seems to be overflowing or something in the darkest/lightest areas?
yes.
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.
oh, bless the lazy, but i really have to find the docs somewhere.
mfg.asd.r IOhannes
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
On Tue, 22 Feb 2005, Mathieu Bouchard wrote:
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.
I was thinking about the "Gamut Warning" message that appeared when you were in a context where the values had to be clipped during (paper)CMYK-to-(CRT)RGB conversion. It was long ago (only used Photoshop 3.0).
I never figured out how it did know I had a CRT, because the LCD screens have goddamn deeper cyan/teal colours... (I smell a SNAFU)
_____________________________________________________________________ Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju