Palettes, pixels and colours; a deep-dive into the Wolf3D palette
For over three decades, we've been creating new graphics for Wolfenstein 3D. New walls, new guards, new weapons and virtually anything else you can think of. And, for the most part, we've been doing so using the very same 256-colour palette that id Software used back in 1992. But have you ever wondered how many of those 256 colours are actually used? Are there colours that id Software never used in its original graphics? And, perhaps more interestingly from a modding perspective, could we introduce entirely new colours without having to redo any of the original artwork? We figured it was worth investigating. So we conducted what we'll call the Wolfenstein 3D Palette Audit.
The palette we all know

The original Wolfenstein 3D palette, featuring all 256 colour entries.
Anyone who's spent a considerable amount of time creating graphics for Wolfenstein 3D will undoubtedly recognise the image above. There are plenty of shades of grey, brown, red and blue, but also some rather extravagant shades of pink, purple and lime green. Unlike modern games, where we're essentially free to use whatever colours we like, Wolfenstein 3D works with a fixed selection of 256 colours. Every pixel in the original graphics refers to a particular position within that palette. Change the colour at that position and everything using it changes accordingly. It's a relatively simple principle, but one that offers some rather interesting possibilities. Looking at the original game, one can't help but wonder why some of these colours are even there. When was the last time you saw a bright pink wall in Castle Wolfenstein, anyway?
The Wolfenstein 3D Palette Audit
Rather than going through the original graphics manually and making an educated guess, I decided to approach this somewhat more scientifically. Using the authentic Wolfenstein 3D palette, we had every individual pixel in the original wall textures, decorations and pickups from both Wolfenstein 3D and Spear of Destiny analysed. This also included alternative graphics from the earlier shareware release. That's 204 individual graphics and a whopping 618,757 visible pixels, with another 216,827 transparent pixels excluded from the investigation. Every visible pixel was compared to the original palette to establish how often each colour occurs. The result is the palette audit below.
The Wolfenstein 3D Palette Audit. Each colour is accompanied by its position within the original palette and the number of matching pixels in the graphics analysed.
As you can see, some colours appear tens of thousands of times, others only a handful of times, and some don't appear at all. Of the 256 available palette entries, the initial investigation revealed that 231 had matching visible pixels, whilst 25 had none whatsoever. For the time being, we've deliberately left out the guards, bosses, first-person weapons and interface graphics. Nevertheless, the results already provide some rather interesting insights into how id Software made use of its original palette and, perhaps more importantly, how we as modders could make better use of it ourselves.
Fifty shades of grey. Well, almost.
Perhaps unsurprisingly, grey turns out to be the dominant colour family in Wolfenstein 3D. In fact, the eleven most frequently used distinct colours in the graphics analysed are all shades of grey, accounting for approximately 36% of all visible pixels.
Considering the sheer number of stone walls, steel doors, prison cells and concrete structures throughout the original game, this probably won't come as much of a surprise to anyone who's spent a considerable amount of time playing or modding Wolfenstein 3D. Brown also features prominently, largely thanks to the wooden walls, furniture and various stone textures. Interestingly enough, despite Wolfenstein 3D being a rather colourful game by early nineties standards, much of its graphical identity is built around a relatively modest selection of colours. What we find particularly interesting, however, isn't necessarily which colours are used most frequently, but which ones aren't used at all.
The forgotten colours of Wolfenstein 3D
This is where things get interesting from a modding perspective. Of the 256 entries in the original palette, the analysis identified 25 without a single visible pixel in the graphics analysed. One of these is the familiar magenta colour associated with sprite transparency, which we'll leave alone for obvious reasons. That leaves us with 24 potentially available colours.

The highlighted colours have no visible occurrences in the analysed graphics. The faded colours are already in use.
What's particularly interesting is that these colours aren't all scattered randomly throughout the palette. Several of them form entire colour ranges. Eight shades of yellow-green, six shades of purple, eight shades of pink and magenta, and two individual colours. Having entire ranges of unused colours is considerably more interesting than having a few individual colours available here and there. After all, when creating graphics for Wolfenstein 3D, we generally don't just need a single new colour. We need several shades of that colour to create depth, shadows, highlights and texture. And, frankly, we can think of quite a few more practical applications for eight shades of olive green than eight shades of bright pink in a Second World War-themed mod.
Giving the original palette a new lease of life
Over the years, we've seen plenty of Wolfenstein 3D mods featuring custom palettes. Some have made subtle alterations to the original palette, whilst others have done away with it altogether. The disadvantage of the latter approach is, of course, that it often requires a considerable amount of additional work on the original graphics. Walls, objects and enemies suddenly no longer look quite the way they were intended to. Personally, we think there's quite a bit of potential here, we're effectively looking at the possibility of reclaiming just over 9% of the original palette for entirely new graphics, without having to alter any of the original artwork included in this investigation. Not bad for a game that's been around since 1992.
Not quite 256 different colours
Another interesting observation is that some of the colours in the original palette are actually identical. Although they occupy different positions within the palette, they produce exactly the same colour on screen. Think of it as having two pots of paint containing exactly the same shade, but with different numbers written on the lids. From a graphical perspective, there's no visible difference between them. From the game's perspective, however, they're two entirely separate colours. This raises another interesting question. Could we combine those duplicate colours and free up even more space within the original palette? Potentially, yes. If we were to make all graphics using one of those duplicate colours refer to the other instead, we could theoretically reclaim the redundant palette entry without changing the appearance of the graphics. There is, however, a limitation to this particular investigation. As I've been working with exported sprite sheets rather than the original indexed game graphics, there's no way of telling which of the two identical colours a particular pixel originally referred to. That would require some additional investigation using the original game files. Something for a future article, perhaps.
Before you start changing your palette...
As tempting as it may be to fire up your favourite palette editor and start replacing colours, we're not quite there yet. The guards, bosses, first-person weapons, menus and status bar still need to be analysed. A colour that never appears in a wall texture might very well appear somewhere in a guard's uniform, a weapon animation or even a single frame of BJ's face on the status bar. There's also the matter of colours used directly by the Wolfenstein 3D engine itself, rather than by the graphics. Depending on the source port you're using, there may also be additional considerations regarding shading, lighting and screen effects. In other words, a colour that isn't used in the original graphics isn't necessarily a colour that the game never uses. So, for the time being, consider these 24 colours potentially available rather than definitively redundant. Nevertheless, it's a promising starting point.
Thirty-odd years later, we're still counting pixels
One of the things we continue to appreciate about Wolfenstein 3D is that, even after more than three decades of modding, there are still aspects of the game worth investigating. Something as seemingly straightforward as a 256-colour palette can open up an entirely new discussion about graphical possibilities, technical limitations and how we can make better use of the resources available to us. We've spent decades creating new graphics for Wolfenstein 3D, often working around the limitations of its original palette. Perhaps some of those limitations aren't quite as restrictive as we've always assumed. We'll be continuing this little experiment by including the remaining graphics, investigating the duplicate colours and looking into the colours used directly by the engine, with the eventual aim of establishing exactly how many palette entries we can reclaim without affecting the original game. And, who knows, perhaps we'll end up with an extended version of the original Wolfenstein 3D palette that the wider modding community can make use of. We'd certainly be interested in hearing what other modders would do with those additional colours.
To be continued!
Happy Wolfing!

