In search of a PAL region reference palette

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

Moderator: Moderators

User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

In search of a PAL region reference palette

Post by rainwarrior »

So, we've always had debates about a palette to represent the NTSC NES output as RGB colours. We have subjective favourite palettes. We have objective mechanical captures of specific device chains. We have efforts to match particular device chain + CRT to a particular palette + LCD. We have theoretical models of it, and a few good generators.

While the hot debates of preference are confusing, we at least seem to have figured out some sort of representative ballpark of how the NTSC palette works. PAL, on the other hand, I can find very little about. I also do not own a PAL NES to test for myself, unfortunately.

I did make palette test ROMs a few years ago, which made it easy for me to take a quick video capture of a few setups I had, but I do not own a PAL system to test in the same way for comparison. All that is needed is a short video containing each of the 8 emphasis settings. Obviously a single capture setup isn't definitive, but it's at least an objectively measured point of reference.

However, even a set made by careful "by eye" comparisons of a CRT vs. the RGB on an LCD, as compromised as that might be, would be much better than the little I have been able to find.


So, here is what I've gathered. Please correct me if I get the details wrong:


The PPU has 12 hues available, in columns $1 through $C. Each step is a 30° rotation in UV chroma space, where the colourburst begins at 0° (a greenish yellow).

According to our Wiki, on NTSC the colourburst is generated by a column 8 pattern, placing that column's hue at exactly 0°. On PAL the colorburst alternates between 6 and 9 each line, giving an average of 7 + 1/2. This effectively places column 8 at 15° rather than 0°, and the rest proceed in 30° steps from there.

There's a few details I haven't reconciled with this. I've read that NTSC is YIQ and PAL is YUV, and that these two spaces are the same but 33° rotated. However, videos I can find of vectorscopes seem to be showing an NTSC colourburst on the U axis, and PAL as a pair 45° from it. This leaves me confused about where the 33° rotation of YIQ is relevant. The wikipedia article about YIQ suggests that there's an alternative decoding called R-Y and B-Y but I'm unclear about what way it's an alternative. Should the difference really be 33° - 15°, rather than just 15°?

Anyway, this leads to a theoretical set of hues, compared here against a Vectorscope diagram indicating standard angles for colours calibrated with a colour-bars picture. In this chart: blue, magenta, red, yellow, green, cyan.

Code: Select all

 Column          1   2   3   4   5   6   7   8   9   A   B   C
 NTSC angle    150 180 210 240 270 300 330   0  30  60  90 120
 PAL angle     135 165 195 225 255 285 315 345  15  45  75 105
 BMRYGC            168     240     284     347      62     104
This suggests that NTSC should have nearly-true magenta ($4) and green ($A), and PAL should have nearly-true blue ($2), red ($6), yellow ($8), and cyan ($C).

Using Drag's NES palette generator, I generated two palettes with the default settings except for hue. I used 0 hue for NTSC, and -0.262 for PAL (-15° in radians). I believe this adequately matches the theoretical difference between NTSC and PAL which I outlined above, but I do not know if this is a good representation of the difference. Essentially the hues are just shifted by half a column.

Just below this are two palettes I derived from the only emulators I could find that so far attempt PAL NES colour emulation. FCEUX 2.6.5's PAL filter (FeosTAS) at default settings, and Nintendulator 0.985's PAL palette. I don't know to what degree either of those should be considerd representative, but they're the only thing I could find to go on.
  • Drag's generator at 0° (NTSC)
  • Drag's generator at 15° (PAL, theoretical)
  • FCEUX 2.6.5 PAL filter
  • Nintendulator 0.985 PAL palette
drag_0_vs_15_degrees.png
drag_0_vs_15_degrees.png (4.96 KiB) Viewed 2151 times
FCEUX_265_PAL_filter__Nintendulator_0985_PAL.png
FCEUX_265_PAL_filter__Nintendulator_0985_PAL.png (5.22 KiB) Viewed 2151 times
Do these match the theoretical 15 degree shift? This seems hard to evaluate, especially since other factors like saturation vary a bit between examples. (Also Drag's generator has -0.1 by default for hue, rather than 0 which I used here. I don't know if this is meant to suggest that the NES NTSC PPU might have an extra ~6° shift on its colours?)

Also I've completely ignored discussing gamma, saturation, sRGB, etc. here. These are all relevant to generating a good representative palette, but as far as I know those factors should be equivalent between NTSC and PAL? Not sure if that's really true, but I've made that assumption because I've seen no information to suggest they should really be treated differently in that respect, at least.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: In search of a PAL region reference palette

Post by lidnariq »

There are some samples in my old thread here - especially note posts from Eugene.S
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: In search of a PAL region reference palette

Post by NewRisingSun »

I've read that NTSC is YIQ and PAL is YUV, and that these two spaces are the same but 33° rotated.
If you are talking about the bare formula used to obtain YIQ from RGB, and YUV from RGB, then that is correct. However, in addition to the mathematical derivation, both terms are associated with additional properties: YIQ is associated with I having a higher bandwidth (sharpness) than Q, while YUV is associated with phase alternation between scanlines. Mathematically, YIQ is indeed just YUV rotated by 33 degrees; if you take the RGB-to-YUV formula and apply a rotation transformation by 33 degrees, you arrive at the RGB-to-YIQ formula.
alternative decoding called R-Y and B-Y but I'm unclear about what way it's an alternative.
YUV decoding is R-Y and B-Y decoding (which should be called "scaled" R-Y and "scaled" B-Y decoding), but SMPTE-170M does not call it YUV decoding, most likely to avoid the phase alternation association. The original 1953 specification does not call scaled R-Y/B-Y decoding anything in particular, but merely refers to "For color-difference signals below 500 Kc, the signal can be represented by", then giving the scale factors for R-Y and B-Y used for what wiki calls YUV decoding/encoding. SMPTE EG 27 calls YIQ decoding "wideband" decoding, and YUV decoding ("R-Y/B-Y decoding") "equiband" decoding. "wideband" decoding is not done by hardware since 1954, and is not done by even a single NTSC software filter in circulation. (It would require single-sideband demodulation for the higher-frequency components of I in addition to regular quadrature amplitude demodulation.)

Of the palettes you posted, only "Drag's generator at 15° (PAL, theoretical)" is realistic in giving you an almost perfect cyan throughout all luminance levels. This is not necessarily pretty-looking for games that use color 0C for a night sky, but "accurate".
These are all relevant to generating a good representative palette, but as far as I know those factors should be equivalent between NTSC and PAL? Not sure if that's really true, but I've made that assumption because I've seen no information to suggest they should really be treated differently in that respect, at least.
They are absolutely completely different at least when using historical specifications. NTSC assumes a black-level set-up of 7.5% and an electro-optical transfer function ("gamma") of 2.2. PAL assumes a black-level set-up of 0%, an electro-optical transfer function of 2.75. NTSC assumes the CIE RGB primary chromaticities defined in 1953 ("1953 NTSC primaries"), while PAL assumes CIE RGB primary chromaticities defined by the European Broadcasting Union in 1970 ("EBU primaries"). NTSC assumes an "Illuminant C" white point, PAL assumes a D65 white point. Modern implementations of NTSC follow SMPTE 170M instead of the 1953 specification, which defines SMPTE "C" primares and a D65 white point. sRGB assumes a gamma of 2.4 with a linear section near black, and "Rec. 709" RGB primaries. "Rec. 709", SMPTE "C" and "EBU" primaries are so close together that no conversion is recommended, as your monitor is likely to differ more from sRGB than these three standards differ from each other. "1953 NTSC" primaries on the other hand are extremely different from 709/SMPTE/EBU. How much all of this matters entails a hefy amount of subjectivity. SInce you only asked about the PAL palette, the answer is: you can pretty much take what is coming out of the YUV-to-RGB conversion matrix and use it directly with an sRGB display without making any conversions.
Last edited by NewRisingSun on Wed Mar 29, 2023 3:28 pm, edited 3 times in total.
User avatar
Individualised
Posts: 310
Joined: Mon Sep 05, 2022 6:46 am

Re: In search of a PAL region reference palette

Post by Individualised »

PAL PPUs have extra grey colours???
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: In search of a PAL region reference palette

Post by rainwarrior »

Individualised wrote: Wed Mar 29, 2023 3:19 pmPAL PPUs have extra grey colours???
No, that's just Nintendulator's palette generator. It's a debugging-oriented emulator, so possibly Quietust wanted them to be distinct for some diagnostic reason.
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: In search of a PAL region reference palette

Post by Drag »

I suspect the PAL PPU uses a different set of voltage levels to generate a PAL signal, compared to NTSC PPUs, and that they'll be necessary to generate an actual PAL palette. If those measurements are available somewhere, I could add them to my palette generator as part of making a PAL mode. :D
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: In search of a PAL region reference palette

Post by rainwarrior »

NewRisingSun wrote: Wed Mar 29, 2023 3:15 pmYUV decoding is R-Y and B-Y decoding...
Ah, thank you.

What I was confused about is why the NTSC colourburst seems to represent the U axis rather than the I axis, or at least that's what our wiki describes, and it did seem to agree with vectorscope videos I found.

So... I am realizing that we can decode the same signal either way. If you want IQ, you can synchronize to the colourburst with a 33 degree shift, and then can do appropriate filtering on those axes. If you want UV, you can use its original phase. Either way the TV has another step converting whichever one it decoded to RGB. Maybe that 33 degree shift is trivially already contained in the decoding implementation, since hue needs to be tunable? Maybe "extra" work for the encoder?

Anyway, I felt like I might have misunderstood it, but that seems to clarify that this is just the way it is. Thank you.

...and of course the PPU is doing something simpler and out-of-spec anyway. Probably in practice IQ vs UV decoding would produce different distortions of the colour, but maybe too subtle for the main question of where these colours "should" lie.
NewRisingSun wrote: Wed Mar 29, 2023 3:15 pmThey are absolutely completely different at least when using historical specifications...
Ah, that's pretty interesting. So, there should be some different tendencies in terms of contrast, gamma, etc.

It's definitely hard to be objective, too, when aside from the fact that monitors aren't particularly consistent, and even if we could start with consistent calibration, local adjustments to taste are necessary for environment, etc.


So, I think it seems you've at least confirmed the rule of thumb: PAL hues will be shifted by 15° (half a column) versus their NTSC counterparts.

I dunno if there should be some general comparative trend as well with respect to gamma/etc.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: In search of a PAL region reference palette

Post by tepples »

rainwarrior wrote: Wed Mar 29, 2023 2:21 pm Anyway, this leads to a theoretical set of hues, compared here against a Vectorscope diagram indicating standard angles for colours calibrated with a colour-bars picture. In this chart: blue, magenta, red, yellow, green, cyan.

Code: Select all

 Column          1   2   3   4   5   6   7   8   9   A   B   C
 NTSC angle    150 180 210 240 270 300 330   0  30  60  90 120
 PAL angle     135 165 195 225 255 285 315 345  15  45  75 105
 BMRYGC            168     240     284     347      62     104
This suggests that NTSC should have nearly-true magenta ($4) and green ($A), and PAL should have nearly-true blue ($2), red ($6), yellow ($8), and cyan ($C).
This is something I feel I should mention in the help page of SMPTE bars in 240p Test Suite:
On NTSC, green and magenta
have correct hues, and
yellow, cyan, red, and blue
are about 15 degrees off.
PAL is the other way around.
Thanks for making the table that suggests this.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: In search of a PAL region reference palette

Post by rainwarrior »

lidnariq wrote: Wed Mar 29, 2023 2:50 pmThere are some samples in my old thread here - especially note posts from Eugene.S
Somehow I missed this yesterday.

Here's a summary of the images and videos that still exist in that thread:
  • Pie Chart Blend Test - USB Capture video by TheFox (PAL), showing everything from the $20 row, with vertical alternation against everything else from the $20 row. (Dropbox link thankfully still works!)
  • Dendy Full Palette on CRT - Photo by Eugene.S, seems to suggest Dendy has hues like NTSC NES?
  • PAL Vertical Phase Test - A test of alternating line behaviour by Tepples, shown as capture by HardwareMan (PAL NES?), CRT photo by TheFox (PAL), CRT photo by Eugene.S (Dendy). The Dendy version doesn't have alternating phases?
Unfortunately all off-site images by HardwareMan are unavailable, and most of Eugene.S's images too.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: In search of a PAL region reference palette

Post by rainwarrior »

TheFox's test video included a complete row of $20, so I extracted average colours from it. I've put it in the middle between the theoretical 0°/15° palettes I made earlier.
  • Drag palette 0°
  • TheFox capture (PAL)
  • Drag palette 15°
20row_drag0_thefox_drag15.png
20row_drag0_thefox_drag15.png (2.46 KiB) Viewed 1925 times
Though, I dunno how to interpret it. Some seems closer to the 0° version, some seems closer to the 15° version... $28 is greener than even the 0° palette... I was hoping there'd be a clearer trend, but I suppose there are a lot of factors at play. :S
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: In search of a PAL region reference palette

Post by Drag »

Does it look closer if you use the SMPTE or the sRGB colorimetry settings?
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: In search of a PAL region reference palette

Post by rainwarrior »

So, same as above, default settings, hue 0, hue -0.262, but this time choosing the SMPTE colorimetry:
20row_drag0SMPTE_thefox_drag15SPMTE.png
20row_drag0SMPTE_thefox_drag15SPMTE.png (2.39 KiB) Viewed 1903 times
It's still back and forth, though I think the hues are closer to the 0 degrees version more often than the 15 degrees version.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: In search of a PAL region reference palette

Post by NewRisingSun »

I can offer my palette generator's output:
Attachments
Palette Test by Loopy (PAL palette).png
Palette Test by Loopy (PAL palette).png (3.14 KiB) Viewed 1887 times
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: In search of a PAL region reference palette

Post by rainwarrior »

Transformed into the other form for easier comparison:
NewRisingSun_PAL.png
NewRisingSun_PAL.png (2.44 KiB) Viewed 1872 times
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: In search of a PAL region reference palette

Post by Drag »

I think I know what's happening: my palette generator now includes the hue shift that occurs on the lighter rows of the palette (the "row skew" setting, also in radians). Row skew is applied like this: hue += rowSkew * rowNum.

On default settings, the third row from the top (rowNum = 2) gets an additional hue adjustment of -0.174 (-10°), plus whatever you entered in the "hue" setting. This skew is different between revision E (-2.5°) and G (-5°), and is probably also different on PAL PPUs.

If we know that the PAL palette is offset by -15°, but the third row looks like it's shifted too far when you set it to that, then try lowering the row skew setting (or set it to 0 to remove it completely) and see if that makes it look better.
Post Reply