Why only 52 colors instead of 256?

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

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Why only 52 colors instead of 256?

Post by Drew Sebastino »

Gilbert wrote:Or, better, fire the one who decided 4 sub-palettes were already enough for the Mega Drive, backgrounds and sprites combined.
Though as explained in the Famicom's case here, there were many reasonable... er... reasons to this, Sega seemed to be quite bad in this area. The Game Gear is another odd ball, as it has a HUGE master palette despite having only 2 sub-palettes (though some games did change colours mid-screen), and this is more or less the only improvement over the original SMS (and the reduced resolution, if you call this an improvement).

What I really want to do with time traveling though, is to let the PC Engine have a larger master palette (4096 colours is enough). This can certainly make its arcade and PC conversions much more accurate. And AFAIK this is relatively "easy" to pull off too. You only need to change the VCE and keep the original VDC, which was already done by some arcade games using the same VDC and probably the PC-FX, which I'm not very familiar with its specs, but I think its VDC was just a minor upgrade from the PCE one.
Or even better, fire who decided that SPPU space was better used for a limited, gimmicky hi-res mode than enough space for each oam entry to be 5 bytes instead of 4 and 1/4. I've asked this before, but was the SNES originally going to have twice the vram bandwidth or something, because half of the video modes are so crippled by it that they're useless.

Color is where basically where every home console was severely behind. Even the SNES, which is considered "colorful" (really only in comparison to the Genesis) has 1/16 the amount of palette entries as the Neo Geo, which has a standard number of palette entries for arcade systems of the time. No other spec is even close to that far behind. Even the GBA, which handily destroys the Neo Geo and other arcade machines of the time, has 1/8 the palette entries. (Which really make the 8bpp support for sprites and BGs far less useful.) I don't know how much more a 2-8KB ram chip would have cost in 1990.
ap9
Posts: 43
Joined: Sat Jun 01, 2013 11:55 am
Location: Maine, U.S.A.
Contact:

Re: Why only 52 colors instead of 256?

Post by ap9 »

As far as I know, the VS/NES model was deliberately kept simple to a degree: first, to minimize costs (hitting the intended price point was not particularly easy). It was definitely biggest bang for the buck. Another benefit of simplicity is how easy it is to program at first.

Color wasn't expected to be dynamic in the early '80s, and fun overshadowed realism. How can we forget how popular the Gameboy was despite providing only four shades of gray (or greenish gray) total? (Granted, the handheld market was different, but the point of producing fun games remains.)

And so the PPU had only 32 palette entries - eight attribute regions for any 2-bit pixel, and only 6 bits of color selection. The developers were more focused on quality assurance on the final product, and too much time thought about slight improvements would have held back subsequent console designs. It was the next home console to support 256 colors standard, the SNES/Super Famicom.

It's still interesting to find new potential for the old console, though.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Why only 52 colors instead of 256?

Post by tokumaru »

ap9 wrote:the PPU had only 32 palette entries
Actually, 28 palette entries, but only 25 can be used normally, the remaining 3 can only be displayed if rendering is turned off.
ap9
Posts: 43
Joined: Sat Jun 01, 2013 11:55 am
Location: Maine, U.S.A.
Contact:

Re: Why only 52 colors instead of 256?

Post by ap9 »

tokumaru wrote:
ap9 wrote:the PPU had only 32 palette entries
Actually, 28 palette entries, but only 25 can be used normally, the remaining 3 can only be displayed if rendering is turned off.
Yes, forgot that only 28 entries actually exist in palette RAM. 7 in 32 mirror entry #0 -- 3 of which won't render because all #0 pixels are "transparent," and OAM-side "transparent" colors won't be put on screen unless rendering is disabled.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why only 52 colors instead of 256?

Post by psycopathicteen »

tokumaru wrote:
ap9 wrote:the PPU had only 32 palette entries
Actually, 28 palette entries, but only 25 can be used normally, the remaining 3 can only be displayed if rendering is turned off.
I didn't know that, how are the extra 3 colors used?
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Why only 52 colors instead of 256?

Post by tokumaru »

psycopathicteen wrote:I didn't know that, how are the extra 3 colors used?
Turn rendering off and set the VRAM address to point to the color you want to show, the PPU will then output that instead of color 0. Not the most useful feature in the world, but still.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: Why only 52 colors instead of 256?

Post by DRW »

Bregalad wrote:I'm sorry but those kinds of questions [...] have already been asked over and over and there's no answer. [...] Asking here is irrelevant. Your quesiton is unanswerable for us.
Followed by a whole bunch of answers that detail the technical reasons for this. :lol:

Reminds me of the situation where we were discussing why the nine sprites overflow fails when used right from the beginning of a game.
There was a definite explanation for it:
The PPU skipping the rendering of certain sprites for one frame if you set PPUMASK to 0 outside of vblank, which you usually do once right in the beginning. Hence the nine sprites flag doesn't trigger since there actually aren't nine sprites on the scanline in this one frame, so the problem was caused by an unrelated issue, but the nine sprites effect itself was not to blame since it worked as intended.

But then there was also that moron who, via private messages, told me:

"Sprite overlfow is buggy, don't use it."
"You'll still run into the sprite oevrflow bug. Sprite overflow breaks with sprite rendering order in such. You can not use it. Use an MMC3 mapper, that is the only way to do it correctly."
"It never works. 9 sprites to trigger the overflow will fail randomly"
"if you read the sprite overflow flag in your game, it is bound to fail. You can NOT use it."
"I'm sorry you feel so defensive for using crap code because you utilize known-broken hardware."

Good thing most of the people on this forum are not of the "What a noob! Why you ask so stupid questions? What you wanna know cannot be done/explained" kind, but actually investigate the issue and find reasonable answers instead of simply saying: "It just doesn't work, duh!"
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Why only 52 colors instead of 256?

Post by Bregalad »

Followed by a whole bunch of answers that detail the technical reasons for this. :lol:
None of the posts in this threads are answers to your original question (of course because it's not answerable), they are just comments about the topic of colour palettes - or answers to your questions from your second post which are, indeed, answerable.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: Why only 52 colors instead of 256?

Post by DRW »

Original question:
DRW wrote:So, is there a technical reason why the total number of colors on the NES is only 64 (52 + a few black entries) instead of 256?
Elaboration:
DRW wrote:I would understand it if the palettes occupied only 24 bytes (6 bits for each of the 2 x 4 x 4 entries). But they take the full 32 bytes (8 bits for each of the 2 x 4 x 4 entries).
One of the answers:
AWJ wrote:The PPU's internal palette RAM is only six bits wide.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: Why only 52 colors instead of 256?

Post by ccovell »

Probably most people assumed your question was "why did the PPU designers decide to use 6 bits for palette values rather than 8 bits"

as perhaps some of us have seen similar, practically unanswerable, questions on this and other boards. Few of us stiill have the early-80s Ricoh/Mitsubishi chip designers' phone numbers in our Rolodexes.

I'm sure some of us should feel sorry for being so presumptuous.
ap9
Posts: 43
Joined: Sat Jun 01, 2013 11:55 am
Location: Maine, U.S.A.
Contact:

Re: Why only 52 colors instead of 256?

Post by ap9 »

According to this website (or The History Of Nintendo vol. 3), Shigeru Miyamoto himself designed the palette and its color count. "Enough color to make something nice but not a lot to avoid the high price of production. Each decision about a color will influence Game’s apparences on this console. At the end, they decide to make 56 different colors." He wanted more blues to distinguish water from sky blues for developers. It's also said that he wanted 56, so the darker scale (column #13) may not have been so black in the beginning.

If his reasons aren't detailed further in the literature, we can only speculate on the rest.

SMS's full 64-color palette would have been more complete, but the electronics would have definitely been more expensive for that because we're not dealing with RGB, we're dealing with the NTSC equivalent of HSL. After some thought, I realize that:

64 is the first power of 2 to contain 12 four-shade hues - the most basic palette you could have to feature all 6 full-contrast RGB hues and one gradation in between each (one orange column). Add two gray scales and you have 14 used columns. The first column was brightened so the leading gray (#0) met about 50% intensity, and so the redundant white became the voltage limit against desaturation (which has no effect on a gray). The second gray scale became more of a black scale considering they literally became black in the RGB PPU.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Why only 52 colors instead of 256?

Post by Bregalad »

ap9 wrote:He wanted more blues to distinguish water from sky blues for developers.
There is not "more blues", all 12 coloured columns are equally spaced in the hue space. Each named colour is free to interpretation about how far we want to call it that name before it really becomes another colour.
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Why only 52 colors instead of 256?

Post by lidnariq »

It's perfectly plausible that "more blues" meant "in comparison to most 2nd generation video game consoles". The Intellivision, Channel F, Odyssey², as well as the contemporary computers (e.g. VIC-20, Atari 400, Apple 2) had very limited master palettes.

Thus, it could have been part of the original design document that specifically led to the cost-reduction choice of using a single (NTSC×6) master clock instead of needing the TMS9928's need for both a (NTSC×3/2) and (NTSC×2) clock.

(They didn't have to pick that pixel clock. They didn't have to provide colors from all 12 equally-spaced angles around the YUV plane)
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Why only 52 colors instead of 256?

Post by FrankenGraphics »

It is (and it's an interesting perspective), but then again, Betoux identifies one red. I'm on the verge saying the nes master palette has no red colour, or 1 i'd call red in a pinch, while there's several i'd call green, blue, purple. I realize this is a personal judgement, but still...

It's like bregalad says, but at the same time our names for colours are varyingly narrow/broad in definition, and i'm inclined to say that it's mostly cultural rather than individual, at least at a pattern level. Human biology may play a part, too.
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Why only 52 colors instead of 256?

Post by Dwedit »

600px-YIQ_IQ_plane.svg.png
Here's the YIQ color plane.
Cut it up into 12 sections (cut each quadrant into thirds like a pizza), and give it 4 levels of brightness.
Presto, there's your NES palette.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Post Reply