This page describes how I have taken a scientific approach to optimizing the palette for the C64 DTV, in order to get the closest recemblance to the original Commodore 64 palette.
Some other people already did various kinds of work on the DTV palette. David Murray did much of the same I did extracting the DTV palette, although his purpose was to optimize images to be shown on the DTV. Zee did some screen captures of the DTV and optimized it to get as close to Pepto's palette as possible.
My aim here is to grab the palette from a real C64, so that any color distortion that might occur as an artifact of the frame grabber card will be cancelled out when using the same hardware for grabbing the DTV palette.
The palette on the Commodore 64 consists of 16 colors. These are generated by the VIC-II. Before finding the closest match from the DTV palette, we need to know what the real C64 palette looks like. What I have done here is showing the palette on each of my 3 C64s, and 2 extra VIC-II chips I mounted in one of them. The C64s were in turn connected to my TerraTec Cinergy XS frame grabber through a composite connection (in order to be able to compare it with the C64 DTV later), and a single frame of video showing the palette was grabbed. This gave me 5 different C64 palettes:
The data was extracted from the screen dumps (source data) and the Pixelate effect in Paint Shop Pro was used to average the color of the middle of each palette entry. These colors were copied (manually) to the new file.
As we can see from the palette, there are some differences between the 5. Also, we see a fairly large difference between the luminances, even on the last 3, which are 3 different VIC-IIs in the same C64. As such I like the second one best, as I think it has more vibrant colors, but this might just be because of the frame grabber and my computer screen. In order to take the most scientific approach to this, I have therefore decided to take the average of all of them. The result is shown here:
The combined palette can be downloaded either as a Paint Shop Pro palette or a Microsoft palette. Of course you can also just get the PNG above. Please note that this palette also has artifacts from the frame grabber hardware I used, but since I will be using the same hardware for finding the optimal DTV palette, the differences should cancel out eachother.
Now that we have established a baseline of what a C64 palette should look like, let us take a look at the palette on the DTV.
Since I want to find the optimal palette with the Spiff Lumafix, I have used a DTV with this mod. Once again this was connected to my TerraTec Cinergy XS via composite in, and I took a screen shot, cleaned it up in Paint Shop Pro and created this palette:
You can download the Paint Shop Pro palette if you want.
Applying the DTV palette to the combined C64 palette gave the following result (I changed the white and yellow colors to some that I found matched better than the ones Paint Shop Pro selected when applying the palette):
Update 2008-12-20: As 1570 has pointed out, some flickering can occur with certain PAL tricks when the luma of colors 6/9, 2/11, 4/8, 12/14, 5/10, 3/15 and 7/13 are not the same. 1570 fixed my luma values and used this in DTVSlimIntro, and I have now added his fixed values to this table.
The values are as follows:
C64 color num | Color name | DTV color | 1570's fix |
---|---|---|---|
0 | Black | 0 = $00 | $00 |
1 | White | 15 = $0F | $0F |
2 | Red | 54 = $36 | $35 |
3 | Cyan | 188 = $BC | $BC |
4 | Purple | 104 = $68 | $67 |
5 | Green | 217 = $D9 | $D9 |
6 | Blue | 133 = $85 | $84 |
7 | Yellow | 31 = $1F | $1F |
8 | Orange | 39 = $27 | $27 |
9 | Brown | 36 = $24 | $24 |
10 | Light Red | 58 = $3A | $39 |
11 | Gray 1 | 5 = $05 | $05 |
12 | Gray 2 | 9 = $09 | $09 |
13 | Light Green | 223 = $DF | $DF |
14 | Light Blue | 138 = $8A | $89 |
15 | Gray 3 | 13 = $0D | $0C |
Comparing this to Zee's palette there are only minor differences. Whether one or the other is used probably does not matter much, but in any case one of these should be prefered over the original DTV palette.