RGB
non-NTSC broadcast colors
(clipping the video signal to Y+|C| <= 1.20)
NTSC broadcast colors
(scaling the colors to satisfy Y+|C| <= 1.20 (120 IRE), |C| <= 0.34)
That's my take on the colors for the time being. I don't know if it fits on
all accounts, but looks good for a first try. How it's done? Well, I tried
many variants to scale the colors to limit the composite video signal to 120
(IRE) according to the NTSC broadcast specification. The most important thing
is to keep the color's hue constant when scaling. It's also good to keep the
luma (Y) constant as much as possible because the eye is very sensitive
to changes in luminance (which Y encodes more or less) and also because it
preserves the grays of the colors. However, if the limit on the composite
signal becomes rather low, then we also need to scale luma as well. So my
strategy was as follows; If Y+|C| > A (A given, i.e. 1.20), scale the chroma
(C) component down (desaturating) to B (may become 0 depending on A) <= a
given chroma limit, while keeping Y constant, and see if Y+|B| <= A (*). If
that's the case, fine. If not, scale Y down until (*) holds. Works fine!
One problem when scaling colors is that you may leave the color gamut. The
scaling procedure above leads to small YIQ values which do not fall into the
NTSC_RGB color space (i.e. negative RGB values). I therefor have written a
clamping method which projects these out-of-range RGB values onto the NTSC_RGB
gamut following a similar strategy of keeping the hue constant while
desaturating the offending color by moving it towards the center axis
(connecting black and white of the gamut) in a plane perpendicular to
this axis containing the color.
The actual limit 0.34 for |C|, in conjunction with Y+|C|<=1.2, was derived in
such a way that almost all clamped YIQ colors lead to valid NTSC_RGB colors.
So this is an upper limit for chroma if you want to have maximum Y with
maximum C under the constrained that Y+|C|<=1.2 for producing valid NTSC_RGB
colors. Of course, I can rise the limit for |C| which would produce more
vibrant colors, but will require to lower Y (and such the gray scale will be
off) and also requires serious NTSC_RGB clamping. What's interesting is that
the maximal excursion of the composite signal Y+|C| is about ~1.334 and for
|C| about ~0.632. Hence, about half the chroma component of the composite
video signal is lost (if you want to stay true and within the bounds of the
NTSC specification). And this can be see on many NTSC TVs.
Now there is another issue. Many operations on the composite video signal,
i.e. filtering etc., do indirectly manipulate the YIQ values contained withing
the signal producing out-of-range NTSC_RGB colors on decoding. So usually one
would have to clamp these values as well, but I haven't done so, because in TV
there was no color-mapping within the TV producing correct NTSC_RGB values.
The circuit of resistors etc. will "clip" the signal their way with the result
that the colors will change in hue, saturation, and value to a given yet small
degree. So I also just clipped them to [0,1], whereas soft-clipping (like a
vacuum tube does) could be more advantageous, I guess. Hence, I only clamped
the colors on the broadcasting side (which is reasonable) and hard-clipped them
on the end of the TV. The "overshoot" between the bars are due to the filters
and gamma correction. It can be dimmed a bit by better adjusting the filter's
phase, but can never be eliminated unless your filter becomes trivial. So you
will always see this behavior on color NTSC TVs to a given degree (while
displaying color bars, yet barely visible otherwise).
The colors you see aren't absolut colors. To see the real colors, the
coordinates of the primary colors of ones monitor are needed to map the
NTSC_RGB gamut (defined with different phosphors) to the RGB gamut of ones
monitor. To actually see the colors like they're appearing on a given TV needs
the primaries of the TV as well as the primaries of ones own monitor to map
NTSC_RGB to TV_RGB to Monitor_RGB. That's something I'm going to implement
further down the road.
Here is an demonstration of what happens if one just clips the composite
video signal to, for example, 0-100 IRE;
and if properly clamped
The first picture looks a lil more vibrant, but the colors are off. Look for
example at cyan, it turns into green whereas in the second picture the colors
are all fine, yet a bit more desaturated (which is the trade-off). Hue errors
are much more problematic esp. when picturing natural scenes.
Edit: I should also say that the colors are filtered according to the NTSC
standard -- for those trying to judge or recreate the result.