Revisiting the quest for the most accurate NES palette:

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
Firebrandx
Posts: 50
Joined: Fri Aug 26, 2011 3:20 am

Revisiting the quest for the most accurate NES palette:

Post by Firebrandx »

Some of you may recall my previous thread where I wasn't happy with any of the currently-offered NES palettes on various emulators as well as the NESRGB board. I had decided to take on the challenge to generate the most accurate palette based on the NTSC-USA front-loader NES's composite video output. While I had finalized my 'eyeballed' palette, I had intended to do a more accurate direct-measure/capture of the NES composite video output, but I didn't have the equipment at the time to do it... Well I do now, and I just finished the conversion!

So here's how I went about it:

1. NES front-loader RCA-style video output jack hooked into video capture device calibrated to NTSC color bars.

2. Test ROM loaded into the NES that fills the screen with a single palette entry (advanced to the next entry via the controller).

3. Uncompressed video recorded for several seconds of each palette entry.

4. Screen caps taken of each palette entry shown in the video.

5. Screen caps cropped to the visible color shown, and then Gaussian-blurred to average the color.*

* Part 5 had to be done because the NES doesn't display solid colors with its composite output. Instead, they appear with 'fish-netted' type interference. Here's a pic showing the original captured NES color with my Guassian-blurred single color entry next to it:

Image

As you can see, the Gaussian blurring does a good job of approximating the intended color.

So when I got done generating the captured palette, I was quite surprised at how close my eyeball job was comparison:

Image


I'm calling the matter finished with the direct-captured version. If you're interested in trying it out, here's the download to the .pal file:

http://www.firebrandx.com/downloads/fbx ... apture.zip
User avatar
Sogona
Posts: 186
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by Sogona »

Very cool
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by Dwedit »

Just a small warning, most image filters on the PC fail to account for gamma.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
dustmop
Posts: 136
Joined: Wed Oct 16, 2013 7:55 am

Re: Revisiting the quest for the most accurate NES palette:

Post by dustmop »

This is great! Gonna integrate this into my graphics pipeline right away.
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by Dwedit »

Comparison GIF showing this new palette vs Nintendulator's palette. (The Darker one is the new one)
nintendulator_vs_new_palette.gif
nintendulator_vs_new_palette.gif (10.14 KiB) Viewed 15973 times
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by tepples »

This capture card palette has a much greener dark olive ($08) than what I've seen on TVs.

Speaking of "dark olive", I might need to start a new topic about coming up with names of colors that programmers can use when communicating with artists.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Revisiting the quest for the most accurate NES palette:

Post by dougeff »

Wow, gray $10 looks so light. Are you sure you don't have the screen brightness too high?
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Firebrandx
Posts: 50
Joined: Fri Aug 26, 2011 3:20 am

Re: Revisiting the quest for the most accurate NES palette:

Post by Firebrandx »

For me, the problem with the emulator palettes like Nestopia's YUV version is the blue-green shades on the right are far too green. I noticed it when playing the first dungeon of Zelda. They have it as pretty much half blue and half green, but the real hardware favors the blue far more than the green. I noticed this in my eyeball tests, and the capture card also detected the same thing.
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Revisiting the quest for the most accurate NES palette:

Post by Pokun »

tepples wrote:This capture card palette has a much greener dark olive ($08) than what I've seen on TVs.

Speaking of "dark olive", I might need to start a new topic about coming up with names of colors that programmers can use when communicating with artists.
$08 looks kind of green like that on my LCD TV I think.

I like the idea of agreeing on names of the colours.
I've made colour labels in my program to make it easier to remember what colour is what. I just made up names based on how they looked like in the Family BASIC CGSET chart and the Nintendulator palette. If better names was agreed on, I'd love to use those instead.
Here it is (also includes some comments of what games are using what colours):

Code: Select all

;Colour constants:
;Only the 52 unique/safe colours out of the 64 possible colours are included.
;Excluded colours are: The "forbidden greyscale" ($0D, $1D, $2D and $3D), the
;white $20 (since it's identical to $30) and all of the blacks that are
;identical to $0F (the $0E-scale, $1F, $2F and $3F).

;Colour scales goes from 0-3 (darker to lighter).
;Colour names should only be seen as a general guidance.
;For example waterblue and skyblue may both be used for water or sky,
;yellow may also contain orange and purple may contain pink and so on.

;-------------------------------------------------------------------------------
;Black and White

col_black = $0F ;classic black backdrop colour
col_white = $30 ;most commonly used white

;-------------------------------------------------------------------------------
;Grey

col_grey0  = $00 ;dark grey, DQ mountains
col_grey1  = $10 ;light grey, DQ mountains

;-------------------------------------------------------------------------------
;Blue

col_waterblue0  = $01 ;FF menu blue
col_waterblue1  = $11 ;DQ water/sky, Rockman armor (dark part)
col_waterblue2  = $21 ;FF sea, thief hair
col_waterblue3  = $31 ;FF sea

col_skyblue0    = $02
col_skyblue1    = $12 ;DQ hero blue armor
col_skyblue2    = $22 ;Super Mario Bros sky
col_skyblue3    = $32

col_plumblue0   = $03
col_plumblue1   = $13
col_plumblue2   = $23 ;Akumajou Dracula whip
col_plumblue3   = $33

col_purple0     = $04
col_purple1     = $14
col_purple2     = $24 ;Lady pink (Donkey Kong)
col_purple3     = $34 ;Akumajou Dracula whip

;-------------------------------------------------------------------------------
;Red

col_pink0      = $05
col_pink1      = $15
col_pink2      = $25 ;Lady pink (Family BASIC), cursor (Donkey Kong)
col_pink3      = $35 ;Lady skin (Family BASIC), DQ common skin

col_red0       = $06 ;Donkey Kong brown
col_red1       = $16 ;Mario red
col_red2       = $26
col_red3       = $36 ;Mario skin, FF common skin

col_yellow0    = $07
col_yellow1    = $17 ;Lady hair (Family BASIC), barrel brown (Donkey Kong)
col_yellow2    = $27 ;Samus yellow, Lady hair (Donkey Kong), DQ tree stem
col_yellow3    = $37 ;Zelda I ground, DQ desert/hill

col_brown0     = $08
col_brown1     = $18 ;FF monk hair, MetaFight bush
col_brown2     = $28 ;FF thief/monk skin, MetaFight bush
col_brown3     = $38 ;Rockman face and rockbuster beam

;-------------------------------------------------------------------------------
;Green

col_grassgreen0  = $09
col_grassgreen1  = $19 ;Luigi green, FF forest
col_grassgreen2  = $29 ;Link green (Zelda I), DQ grass, FF forest
col_grassgreen3  = $39

col_leafgreen0   = $0A ;MetaFight bush
col_leafgreen1   = $1A ;DQ tree/grass, FF grass/tree/forest
col_leafgreen2   = $2A ;Link green (Zelda II), R.O.B screen flash
col_leafgreen3   = $3A

col_bluegreen0   = $0B
col_bluegreen1   = $1B
col_bluegreen2   = $2B
col_bluegreen3   = $3B

col_turquoise0   = $0C ;DQ title screen backdrop, DQ slime
col_turquoise1   = $1C
col_turquoise2   = $2C ;FF stream, Rockman armor (light part)
col_turquoise3   = $3C

;-------------------------------------------------------------------------------
;64 Famicom colour chart:
;
;  ^    Hex:
;  |------------------
;  |    00  10  20  30  GREY ~ WHITE
;  |------------------
;  | B  01  11  21  31
;  | L  02  12  22  32
;  | U  03  13  23  33
;  | E  04  14  24  34
;  |------------------
;  | R  05  15  25  35
;  | E  06  16  26  36  EXISTING COLORS
;  H D  07  17  27  37
;  U    08  18  28  38
;  E------------------
;  | G  09  19  29  39
;  | R  0A  1A  2A  3A
;  | E  0B  1B  2B  3B
;  | E  0C  1C  2C  3C
;  |-N----------------
;  |    0D  1D  2D  3D <----- Forbidden greyscale (0D, 1D, 2D, 3D)
;  |    0E  1E  2E  3E  BLACK
;  |    0F  1F  2F  3F
;  |------------------
;  v
;   <-DARK-----LIGHT->
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Revisiting the quest for the most accurate NES palette:

Post by dougeff »

Funny, I always thought of the x7 column as oranges and the x8 column as yellows.

And why are the xD grays 'forbidden' ?
nesdoug.com -- blog/tutorial on programming for the NES
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by tepples »

$0D has a voltage lower than black and can confuse the sync parsing in some TVs.
$1D is equal to $0F.
$2D and $3D are unavailable on 2C03 RGB PPUs, but they're so close to $00 and $10 that they're not too useful anyway.

And I too was about to assign the name "orange" to column 7 and "yellow" to column 8. I guess I need to finish my proposal and post it.
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Revisiting the quest for the most accurate NES palette:

Post by Pokun »

dougeff wrote:Funny, I always thought of the x7 column as oranges and the x8 column as yellows.

And why are the xD grays 'forbidden' ?
Ninjad by Tepples about the "forbidden colours". Also any of these forbidden colours may fade into the bad $0D (if you fade by subtracting with $10) unless your fading routine is designed to work around it. So there's so many reasons not to use them I thought.

I named the x7 column from col_yellow2 since it's the colour of Samus armor and it's known to be yellow. Colours are generally named after one colour in their column not their "actual colour". And for names like bluegreen and turquoise, I'm not sure which is closer to blue and which is closer to green or if they are words with identical meaning even.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by rainwarrior »

What about the 7 emphasis states, Firebrandx?
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by Dwedit »

Emphasis isn't used all that much by games, pretty much a few games that run in deemphasize all colors mode for some reason, Final Fantasy 1 during battle transitions, and Noah's Ark.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Revisiting the quest for the most accurate NES palette:

Post by rainwarrior »

We have an imcomplete list of emphasis-using games, but I would presume that a "quest for the most accurate NES palette" shouldn't ignore 87.5% of the colours it can produce just because not many games use them.
Post Reply