What is the deal with colors $22 and $x8 range? LCD vs CRT?

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

frantik
Posts: 377
Joined: Tue Mar 03, 2009 3:56 pm

What is the deal with colors $22 and $x8 range? LCD vs CRT?

Post by frantik »

Color $22, most well known for the sky in Super Mario Bros, seems to be one of the most poorly represented colors in most emulators. I have seen it be anything from a deep blue to light purple. Most of the palettes/emulators claiming to be accurate show it as a bluish purple color. If I plug my Nintendo into an LCD display, it shows $22 to be very close the purple color I see on the "accurate" palettes. So I've sort of just assumed that the color is indeed slightly purple and I was just remembering it being more blue when I was a kid... But today I picked up a CRT from the early 2000s.. and boy that sky is undoubtedly BLUE, without any hint of purple! I messed with the color settings and did get the more purple sky, but the rest of the colors seemed off when I did that.

I've also noticed the the $x8 range tends to show up as a yellow-green color in "accurate" palettes as well as on my LCD display. Using $38 for a sky color on my LCD looks like a kinda "puke yellow" color, but it looks great on the CRT, with the brighter shades like $38 and $28 being much more yellow/brown without green.. though the darker $08 is still slightly olive.

I have been working on updating a hack of mine, with one of the goals to update the color choices to look best on a real system with CRT while also looking good on emulators which have accurate palettes. Up until now I've been using puNES and FCEUX with NTSC mode enabled since they seemed close to my LCD, but neither of them look like this CRT i picked up.. in fact some of my original color choices based on FCEUX's original completely non-accurate palette look better than the updated choices. I know in the end it's up to the TV to decide how the colors are displayed, but it's maddening trying to pick the right colors, especially if you would like to use these colors which seem to be the most widely varied.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by FrankenGraphics »

My biggest problem with palette definitions is FCEUX misrepresenting colour $2D as a lot brighter than i've ever seen it on any tv. If you turn the contrast all the way down, you get something similar to fceux, but then every other colour is also affected by lack of contrast. Given that FCEUX is a very popular emulator, that's problematic for me since i like to use that colour for precicely that usage.

I guess that since many developers stay away from the $xD column for compability issues with some fringe versions (playchoice, vs. system, famicom titler, and famicom tv), it hasn't been a priority. neslib even scrambles $xD into the $x0 column, which makes for a too bright glitch, since the both the $x0 column has intentionally de-aligned brightness values compared to the other columns.

Some thoughts on the OP colours:
It's not a full explanation, but part of it could be that hue is harder to discern for the human eye than brightness, and there is a lot of individual variance in the capability to distinguish hue. Since the blues and greens of the master palette are more finely represented (to the degree of sometimes almost being pointless) than reds and yellows, they are harder to distinguish, and by extension, represent. You can do it mathematically, but once you get into analog or optical territory, it gets hairy.

In my experience, screens and CRT:s especially are swinging wildy in warm/cold balance from model to model. Even my HDTV is a lot warmer than my laptop and secondary computer screen. What falls into a cold green distinction to my eyes on the former may sometimes be jade or teal on the latter ones.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by lidnariq »

Drag's palette generator shows that a lot of colors are out of gamut, and different TVs will do different things with colors that are out-of-bounds (both in terms of U/V/I/Q or R/G/B). You can play around with this with the various toggles there.

This doesn't even cover the more-recently documented variable phase shift for different brightnesses (causing hue rotation on NTSC and hanover bars on PAL)
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by NewRisingSun »

It seems everybody has had this moment of connecting a NES to a real CRT, seeing a particular color looking more x-ish rather than y-ish and coming to think that those emulation people got it all wrong --- until they connect the same NES to a different CRT, and coming to realize how inherently variable and unstable the NES' color generation really is. There are just sooo many things going on:
  • Even when black and white levels are perfectly normalized, almost all colors will be either clipped at black or at white because the NES outputs overly saturated colors in the first place (as a result of not originating as RGB in the first place)
  • Incorrect color burst and sync amplitudes, some of which are used by TV's automatic gain control for video signal normalization, yielding to brightness and contrast far and unpredictably different from ideal normalization, further changing what the effects of clipping will be.
  • CRT TVs clipping differently, at least at the upper bound, than digital displays. Simply put, CRT phosphors oversaturate rather than clip. Also, TV displays (CRT and LCD) typically are much brighter than computer monitors, so at a given mid-range setting, overly-bright video levels may not actually clip because there is still headroom upwards, while computer monitors always clip because there is no headroom.
  • Amplitude-dependent phase distortion from signal reflections due to poor impedance matching in the NES' video path. This is a general problem of the NTSC television system, but the NES is particularly badly affected. It depends on the electrical characteristics of the TV set, the cable type and length, the PPU and console model, and even the temperature. I've had the same console look different, with identical TV settings, at different times of the day. Not greatly so, but noticeably in the "problem" colors in the $x8 range.
  • NTSC TVs either assuming 7.5% or 0% black level setup, changing how much all colors (or at least the $0x ones) are clipped at the lower bound;
  • NTSC decoders using idiosyncratic coefficients to correct for the TV having non-NTSC phospors (i.e. every single TV after 1954), or not correcting at all;
  • Idiosyncratic user-adjusted Hue and Saturation.
Color $22 is the one color most sensitive to video levels and consequently the amount and type of upper-bound clipping, while the $x8 colors are the colors most sensitive to amplitude-dependent phase distortion and the user-adjusted Hue setting.

As for picking colors, I've found that picking shades only in the same phase column and thus not mixing e.g. $x7 with $x8 is generally a safe choice, and using the $3x colors for anything other than highlights is a bad choice (see Sky Kid, for example). I have often scratched my head at some games' color choices, until I realized that several of them must have been made to look good on the 2C03 RGB PPU rather than the home console. For example, SMB3 uses pinkish $36 as a highlight for $27, which looks ridiculous on the home console, but exactly right in the 2C03. For the home console, you would use $37 as a highlight for $27, which would look overly yellow on the 2C03.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by tepples »

NewRisingSun wrote:As for picking colors, I've found that picking shades only in the same phase column and thus not mixing e.g. $x7 with $x8 is generally a safe choice
If only I could get our artist to stop using $06 and $07 next to each other or $0A and $0B next to each other. Those are clearly distinct in luminance in the palette he uses (found in "Applying Artificial Intelligence to Nintendo Tetris" and fornaxvoid.com > Resources > Color Palettes, which galleryNES describes as "NESpalette.png - NES palette found on deviantART, by Erik Red". But they're not distinct on an actual NES or in palettes generated using Bisqwit's generator. It's probably the same deal as the problem you mentioned of classic-era licensed devs tuning game palettes for the 2C03 in their developer hardware.
Meatfighter.com/Fornaxvoid.com palette - where did this come from?
Meatfighter.com/Fornaxvoid.com palette - where did this come from?
pct-indexed.png (2.62 KiB) Viewed 12935 times
For comparison, a palette generated with Bisqwit's web-based generator (defaults except saturation 1.2 and gamma 2.0)
For comparison, a palette generated with Bisqwit's web-based generator (defaults except saturation 1.2 and gamma 2.0)
savtool-swatches.png (2.62 KiB) Viewed 12935 times
And the 2C03 palette, assuming that the 3-bit DACs are linear
And the 2C03 palette, assuming that the 3-bit DACs are linear
2c03-swatches.png (2.56 KiB) Viewed 12935 times
NewRisingSun wrote:and using the $3x colors for anything other than highlights is a bad choice (see Sky Kid, for example).
Menus in RHDE have black text on a $38 background. How does that fail?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by lidnariq »

NewRisingSun wrote:Amplitude-dependent phase distortion from signal reflections
This failure mode is wholly unrelated to signal reflections; there is no aerial nor transmission line stage inside the NES itself. Nothing inside the NES is high enough frequency and all of the traces inside are too short to tickle this behavior.
due to poor impedance matching in the NES' video path.
So it's a little misleading to say that the variable output impedance is poor impedance matching. It's just because the impedance is variable.
It depends on the electrical characteristics of the TV set
Yes, only because the PPU emits out-of-gamut colors.
the cable type and length
No. Reflections are a linear-and-time-invariant error; phase distortion is not. Phase distortion necessarily requires a powered stage.
the PPU and console model, and even the temperature.
That's because the temperature of the PPU itself affects the resistance of the DAC that's used in video generation.
frantik
Posts: 377
Joined: Tue Mar 03, 2009 3:56 pm

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by frantik »

that's an interesting thought about developers developing on a different PPU than the one that was in most people's systems.. seems like that would cause all sorts of color problems.

I still don't get why all the "accurate" palettes show $22 as much more purple than this CRT is showing it, and the yellow/brown $x8 column has almost no green in it on this CRT as well. It's frustrating having such a wide range of colors from emulators to TVs. I guess that's just part of NES graphic development, having to accept that the colors will not be the same on all systems. It's hard to pick which one to be the "definitive" color set too, especially these days where most people are likely to play on an emulator.. 10 years ago it was easier, almost everyone used FCEUX, but now people use emulators, virtual consoles and "NES classic" emulator consoles, all of which also display things differently from the original console
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by NewRisingSun »

lidnariq wrote:there is no aerial nor transmission line stage inside the NES itself. Nothing inside the NES is high enough frequency and all of the traces inside are too short to tickle this behavior
But there can be reflections in the cable from the NES to the TV.
lidnariq wrote:No. Reflections are a linear-and-time-invariant error; phase distortion is not. Phase distortion necessarily requires a powered stage.
I can definitely (slightly) change the displayed colors in the TV by using a different composite video cable. Even if the explanation may be incorrect, the observation is not.
lidnariq wrote:
NewRisingSun wrote:It depends on the electrical characteristics of the TV set
Yes, only because the PPU emits out-of-gamut colors.
Not just because of that. The picture will be of a different brightness and hue when I connect the Twin Famicom to the TV's front composite socket compared to the back composite socket. :?

I have to mention that this variability only occurs with the AN-505BK with its RP2C02G PPU. My other Twin Famicom, the AN-500B with its RP2C02E PPU, is very stable across TVs, cable and connection types, and temperature. And no, I don't know if it's the PPU or just the AN-505BK's video path in general that's causing such variability. We're talking about a maximum hue deviation of about 20 degrees.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by lidnariq »

NewRisingSun wrote:I can definitely (slightly) change the displayed colors in the TV by using a different composite video cable.
I mean, the result of reflections looks identical to a comb filter, where the spacing of reflections is the spacing of teeth in the comb filter. As an LTI system, it could certainly adjust colors on edges, but there's really no way to cause "differential phase" distortion without a powered stage (e.g. clipping in the amplifier, as in early NTSC broadcasting stations; or a voltage-dependent resistance as in the 2C02's analog output).
Even if the explanation may be incorrect, the observation is not.
It would be nice if we actually had multiple different documented complete A/V paths.

In writing my previous reply, I noticed that the A/V path as drawn here doesn't agree with the fragment I reverse-engineered here... So who knows which revision of the RF modulator Electronix Corp's reverse-engineered schematic corresponds to.

Theoretically the 2SA937 and 2SC1740 as specified in Electronix Corp's schematic have hFEs somewhere around 250, and they're both operating as emitter-followers. The higher the gain at this stage, the better the emitter-follower is at isolating the variable resistance out of the 2C02's video output. But transistors can lose hFE as they age ... and given the already-visible variability in video paths, I think it's plausible that some consoles are using worse choices for their transistors here.
NewRisingSun wrote:The picture will be of a different brightness and hue when I connect the Twin Famicom to the TV's front composite socket compared to the back composite socket. :?
I assume, given the thing you said right after, you mean that only the AN-505BK switches in this way between the inputs? And other consoles don't?

Out of curiosity, do both sockets have the same 75Ω input resistance?
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by NewRisingSun »

Reflections themselves may not cause differential phase distortion. But different reflections can cause differently-spaced comb filtering, which will cause different cancellations of original signal components, in turn causing different changes in amplitude, causing different phase distortion in any powered stage on the part of the TV set that displays the signal.

The AN-500B is stable across all TVs, capture cards, cables and sockets that I have tried. The AN-505BK is stable with the capture card, but highly variable when connected to several different Sony TVs. The same Sony TVs show stable colors with other home computers and consoles.

In other words, both the AN-505BK and all my Sony TVs have some kind of electrical characteristic that only together cause phase distortion beyond what I described in that palette thread. I don't know how to measure the impedance of any input or output, but from what I have read, it's not as simple as holding an Ohmmeter to it.
frantik
Posts: 377
Joined: Tue Mar 03, 2009 3:56 pm

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by frantik »

man, phase distortion, I thought that was only something you heard on Star Trek

anyways, I was looking up colors and the color named "periwinkle" or "lavender" appears very similar to the color $22 on many LCD displays. It's a combination of full blue and almost full green and red in equal strength (eg #CCCCFF), but it appears more purple/violet than light blue on LCD.. I don't have a CRT computer monitor but it would be interesting to see if the color appeared differently
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by NewRisingSun »

How purple that particular RGB color looks will (mostly) depend on your monitor's color temperature, which usually can be set from a menu. At 9300K, it will appear to be light blue, at 6500K, it will appear somewhat purplish.
tepples wrote:And the 2C03 palette, assuming that the 3-bit DACs are linear
Has it ever been investigated whether they are, and what non-linearities the circuits outside the 2C03 PPU, that are visible in the schematics, impose?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by tepples »

That and the group delay of an RC circuit varies with frequency, and a cable behaves as a capacitor.

Incidentally, "phase distortion" is used outside Star Trek. It's the name of a Casio synthesizer topology that uses a time-varying piecewise-linear phase modulator with a sinusoidal carrier, optionally ring modulated by a downward sawtooth to cover phase discontinuities, for results that sound somewhere between Yamaha's FM and Roland's subtractive synthesis.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by lidnariq »

NewRisingSun wrote:Has it ever been investigated whether the [2C03/4/5's DACs are linear?]
You can see the 2C04's DACs in the upper left corner of the die shots here. I'm having a hard time reading it, but I don't see any reason to think there's a nonlinearity in the die.

I believe it's just the gamma of the picture tube that the whole thing is ultimately connected to.
and what non-linearities the circuits outside the 2C03 PPU
There shouldn't be any nonlinearities. The output is three emitter followers (the middle stage using emitter degeneration), and an transmission gate + opamp with an extreme lowpass to adjust black level.
tepples wrote:That and the group delay of an RC circuit varies with frequency, and a cable behaves as a capacitor.
Coax does technically have a capacitance per length, but outside of tests specifically designed to demonstrate this, it's misleading to think of it as a capacitor instead of as a transmission line. (Transmission lines are low-pass filters made of an infinite series of inductances and capacitances. In practice, the low-pass corner frequency is quite high, usually at least 1GHz)
"phase distortion"
It is very important in the NTSC context that this is differential phase distortion—that some correlated property causes a variation in the amount of phase distortion.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What is the deal with colors $22 and $x8 range? LCD vs C

Post by NewRisingSun »

lidnariq wrote:I believe it's just the gamma of the picture tube that the whole thing is ultimately connected to.
Plus the fact that the colors were clearly chosen for a CRT with phosphors that are less saturated than sRGB, making reds and browns "glow" on a calibrated sRGB display. In Nintendulator-NRS, I assume "1980's receiver phosphors" from the literature and convert to sRGB to make them look bearable.
lidnariq wrote:It is very important in the NTSC context that this is differential phase distortion
It's also important in the NTSC/PAL context that the Hue setting of a TV cannot correct differential phase distortion, while the original PAL patent specifically promotes its ability to do so.

Any idea about the console and TV combination resulting in what I have observed?
Post Reply