Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Silikone

Redundant palette entries?

Recommended Posts

I've noticed that there are a few indexes in the Doom palette that are identical. This is ostensibly wasteful, and there could have been more room for diversity of color without them. Is there a particular reason for this, like some kind of performance optimization for accessing adjacent bytes during rendering?

Share this post


Link to post

Nope just somewhat sloppy construction of the palette by id. A lot of community projects use these entries to gain additional free colors.

Share this post


Link to post

I think they just weren't trying as hard as they could to use the palette space optimally. Although redundant colors can potentially simplify color remapping in paletted graphics, in the sense that only a single range of adjancent indexes could be processed rather than multiple ranges, which could be convenient for humans and require less complex algorithms in software.

Share this post


Link to post

There are 7 duplicates, and quite a few more near duplicates. What's most missing are blue/green (cyan), truer greens and violet/purple shades. Because you need to think about shading and brightness levels, the best you can hope for is to make a half-functional version of only one of those missing colors.

 

On the other hand, if you have control of player translation ranges, you could borrow a bunch of slots of the more well-represented colors, like grey and red, combine that with the duplicates and near duplicates, and end up with a pretty nice chunk of free slots. If you were careful, you might be able to get upwards of 32 slots or so, without degrading the quality of the original resources too much. Of course, you'd have to translate all the original resources you wanted to use, including sprites, textures, flats, text graphics, etc. Not an easy task, but doable.

Share this post


Link to post
11 hours ago, kb1 said:

There are 7 duplicates, and quite a few more near duplicates. What's most missing are blue/green (cyan), truer greens and violet/purple shades. Because you need to think about shading and brightness levels, the best you can hope for is to make a half-functional version of only one of those missing colors.

 

On the other hand, if you have control of player translation ranges, you could borrow a bunch of slots of the more well-represented colors, like grey and red, combine that with the duplicates and near duplicates, and end up with a pretty nice chunk of free slots. If you were careful, you might be able to get upwards of 32 slots or so, without degrading the quality of the original resources too much. Of course, you'd have to translate all the original resources you wanted to use, including sprites, textures, flats, text graphics, etc. Not an easy task, but doable.

 

Any examples of optimized custom Doom palettes?

Share this post


Link to post
11 hours ago, Silikone said:

 

Any examples of optimized custom Doom palettes?

No, I haven't built anything releasable yet. It's problematic. It's a thing that almost requires some source port support to make it work. Because, for it to work, you have to release all the original Doom resources in your PWAD, after modifying each frame to use the new scheme. I would not be comfortable doing that, unless it could be done as a patch that requires an intact original IWAD.

 

For years, I've been building and hacking on a WAD editor that let's me try a bunch of experiments. A few years ago, I added a feature called

"Palette Reduction":

 

PalUsage.JPG.9706a103b7f84ee8a65d0b6eeeb04689.JPG

 

The tool eliminates the usage of the duplicate colors in all the WAD's images, and it also frees up a few more entries by swapping some rarely used colors with near-duplicates that are used more often. You can see a few of those choices in the "Palette Reduction" section above.

 

Color usage stats are in the spoilers:

 

Spoiler

Here's a list of the color usage in Doom2.wad. It looks a bit ugly on the forum - it's tab-delimited, and should be easily readable in a spreadsheet program. The list is useful to demonstrate how much each color entry is used. This list is before Palette Reduction.


Index	Color	Patches	Flats	Pixels
00	00 00 00	1,039	22	163,496
01	1F 17 0B	1,067	48	190,474
02	17 0F 07	870	24	128,134
03	4B 4B 4B	622	27	25,650
04	FF FF FF	294	1	25,402
05	1B 1B 1B	1,039	53	111,890
06	13 13 13	1,015	28	90,717
07	0B 0B 0B	808	13	47,949
08	07 07 07	494	7	40,565
09	2F 37 1F	416	33	42,240
0A	23 2B 0F	364	29	40,421
0B	17 1F 07	272	15	19,605
0C	0F 17 00	139	8	8,028
0D	4F 3B 2B	587	27	46,448
0E	47 33 23	618	34	89,956
0F	3F 2B 1B	559	33	82,540
10	FF B7 B7	84	1	494
11	F7 AB AB	239	0	2,448
12	F3 A3 A3	210	2	1,714
13	EB 97 97	230	1	2,102
14	E7 8F 8F	238	2	4,041
15	DF 87 87	253	2	4,920
16	DB 7B 7B	274	3	7,498
17	D3 73 73	302	3	7,092
18	CB 6B 6B	364	3	7,919
19	C7 63 63	357	3	13,096
1A	BF 5B 5B	397	3	9,946
1B	BB 57 57	425	3	13,073
1C	B3 4F 4F	479	3	19,130
1D	AF 47 47	496	3	12,849
1E	A7 3F 3F	558	3	23,887
1F	A3 3B 3B	505	4	8,965
20	9B 33 33	612	5	23,057
21	97 2F 2F	633	2	12,425
22	8F 2B 2B	703	4	16,474
23	8B 23 23	686	4	23,884
24	83 1F 1F	717	7	18,486
25	7F 1B 1B	722	7	25,057
26	77 17 17	709	8	21,758
27	73 13 13	611	5	23,390
28	6B 0F 0F	712	10	30,950
29	67 0B 0B	673	8	32,049
2A	5F 07 07	599	8	25,316
2B	5B 07 07	664	8	29,110
2C	53 07 07	700	10	29,161
2D	4F 00 00	713	13	54,549
2E	47 00 00	559	12	29,240
2F	43 00 00	766	17	76,950
30	FF EB DF	197	4	4,288
31	FF E3 D3	236	3	4,105
32	FF DB C7	277	3	5,223
33	FF D3 BB	253	5	2,408
34	FF CF B3	385	5	5,713
35	FF C7 A7	404	6	5,292
36	FF BF 9B	431	4	5,609
37	FF BB 93	447	5	7,316
38	FF B3 83	489	4	7,238
39	F7 AB 7B	595	3	9,879
3A	EF A3 73	562	4	19,360
3B	E7 9B 6B	645	4	14,441
3C	DF 93 63	671	5	22,171
3D	D7 8B 5B	707	4	21,460
3E	CF 83 53	731	5	20,685
3F	CB 7F 4F	712	8	12,599
40	BF 7B 4B	821	5	29,839
41	B3 73 47	936	6	29,539
42	AB 6F 43	909	8	27,631
43	A3 6B 3F	974	15	32,291
44	9B 63 3B	1,103	15	41,475
45	8F 5F 37	1,170	23	49,350
46	87 57 33	1,147	31	51,561
47	7F 53 2F	1,185	35	44,288
48	77 4F 2B	1,209	40	79,680
49	6B 47 27	1,301	56	95,066
4A	5F 43 23	1,295	45	111,793
4B	53 3F 1F	1,303	48	105,024
4C	4B 37 1B	1,368	67	129,144
4D	3F 2F 17	1,331	62	118,292
4E	33 2B 13	1,360	68	215,537
4F	2B 23 0F	1,338	59	211,643
50	EF EF EF	416	5	18,076
51	E7 E7 E7	387	3	10,318
52	DF DF DF	368	3	8,839
53	DB DB DB	436	2	7,165
54	D3 D3 D3	409	5	11,379
55	CB CB CB	474	4	18,028
56	C7 C7 C7	416	3	9,789
57	BF BF BF	510	4	18,367
58	B7 B7 B7	464	3	20,704
59	B3 B3 B3	583	4	18,018
5A	AB AB AB	541	6	13,277
5B	A7 A7 A7	582	4	13,596
5C	9F 9F 9F	684	11	25,059
5D	97 97 97	581	9	10,067
5E	93 93 93	663	13	25,879
5F	8B 8B 8B	709	20	29,449
60	83 83 83	724	17	25,828
61	7F 7F 7F	865	20	45,425
62	77 77 77	929	21	74,098
63	6F 6F 6F	832	23	59,317
64	6B 6B 6B	952	31	51,695
65	63 63 63	920	38	68,520
66	5B 5B 5B	978	37	54,792
67	57 57 57	973	49	66,945
68	4F 4F 4F	1,038	43	63,424
69	47 47 47	971	50	51,349
6A	43 43 43	1,084	45	96,904
6B	3B 3B 3B	1,083	41	61,178
6C	37 37 37	1,027	54	69,594
6D	2F 2F 2F	1,122	60	120,885
6E	27 27 27	1,016	60	169,583
6F	23 23 23	1,023	45	106,719
70	77 FF 6F	50	0	1,509
71	6F EF 67	87	0	1,443
72	67 DF 5F	114	0	2,308
73	5F CF 57	140	0	3,292
74	5B BF 4F	162	0	3,369
75	53 AF 47	190	0	4,875
76	4B 9F 3F	200	3	5,640
77	43 93 37	215	2	5,489
78	3F 83 2F	276	3	7,869
79	37 73 2B	295	6	7,864
7A	2F 63 23	316	6	12,519
7B	27 53 1B	334	7	13,398
7C	1F 43 17	326	11	17,288
7D	17 33 0F	271	12	18,862
7E	13 23 0B	414	23	21,613
7F	0B 17 07	248	10	9,970
80	BF A7 8F	640	4	34,798
81	B7 9F 87	610	4	17,679
82	AF 97 7F	719	4	25,700
83	A7 8F 77	756	4	27,419
84	9F 87 6F	752	9	26,527
85	9B 7F 6B	659	10	17,210
86	93 7B 63	775	14	30,712
87	8B 73 5B	734	12	30,191
88	83 6B 57	804	21	43,543
89	7B 63 4F	791	18	37,477
8A	77 5F 4B	833	27	51,671
8B	6F 57 43	904	34	89,120
8C	67 53 3F	871	46	114,769
8D	5F 4B 37	909	46	127,052
8E	57 43 33	866	50	97,806
8F	53 3F 2F	894	48	103,616
90	9F 83 63	650	5	18,943
91	8F 77 53	581	10	15,126
92	83 6B 4B	664	14	23,149
93	77 5F 3F	678	22	33,468
94	67 53 33	750	28	32,487
95	5B 47 2B	762	38	90,583
96	4F 3B 23	862	55	65,663
97	43 33 1B	1,059	58	107,733
98	7B 7F 63	498	10	32,216
99	6F 73 57	515	12	51,686
9A	67 6B 4F	531	19	45,580
9B	5B 63 47	560	21	94,107
9C	53 57 3B	581	31	87,258
9D	47 4F 33	576	30	63,290
9E	3F 47 2B	614	40	69,299
9F	37 3F 27	676	42	60,468
A0	FF FF 73	183	2	11,362
A1	EB DB 57	232	4	11,330
A2	D7 BB 43	303	5	16,026
A3	C3 9B 2F	314	5	17,354
A4	AF 7B 1F	408	5	29,371
A5	9B 5B 13	477	5	24,488
A6	87 43 07	522	5	26,483
A7	73 2B 00	509	4	25,294
A8	FF FF FF	25	0	276
A9	FF DB DB	108	1	560
AA	FF BB BB	141	1	614
AB	FF 9B 9B	136	1	614
AC	FF 7B 7B	185	4	1,079
AD	FF 5F 5F	243	2	1,787
AE	FF 3F 3F	252	2	2,763
AF	FF 1F 1F	284	3	3,486
B0	FF 00 00	395	3	7,949
B1	EF 00 00	466	6	11,890
B2	E3 00 00	532	6	18,515
B3	D7 00 00	562	6	20,271
B4	CB 00 00	604	7	27,362
B5	BF 00 00	677	8	36,207
B6	B3 00 00	700	11	44,132
B7	A7 00 00	630	10	40,155
B8	9B 00 00	718	13	61,793
B9	8B 00 00	750	15	64,579
BA	7F 00 00	731	17	62,189
BB	73 00 00	694	14	55,206
BC	67 00 00	700	12	73,777
BD	5B 00 00	623	12	61,131
BE	4F 00 00	474	1	15,949
BF	43 00 00	604	4	81,496
C0	E7 E7 FF	34	0	1,062
C1	C7 C7 FF	38	0	957
C2	AB AB FF	31	0	857
C3	8F 8F FF	26	0	988
C4	73 73 FF	50	0	1,065
C5	53 53 FF	57	0	587
C6	37 37 FF	58	1	549
C7	1B 1B FF	43	1	458
C8	00 00 FF	79	1	1,354
C9	00 00 E3	109	1	3,566
CA	00 00 CB	129	1	4,304
CB	00 00 B3	138	5	8,131
CC	00 00 9B	126	10	7,771
CD	00 00 83	139	10	10,270
CE	00 00 6B	144	11	16,930
CF	00 00 53	130	11	18,144
D0	FF FF FF	15	0	190
D1	FF EB DB	164	0	3,551
D2	FF D7 BB	253	0	3,450
D3	FF C7 9B	239	0	3,545
D4	FF B3 7B	136	0	1,474
D5	FF A3 5B	217	0	2,952
D6	FF 8F 3B	184	0	3,029
D7	FF 7F 1B	186	0	3,878
D8	F3 73 17	202	0	3,538
D9	EB 6F 0F	233	0	4,537
DA	DF 67 0F	220	0	5,118
DB	D7 5F 0B	259	0	5,129
DC	CB 57 07	255	0	9,061
DD	C3 4F 00	221	0	9,099
DE	B7 47 00	238	0	6,846
DF	AF 43 00	251	0	5,527
E0	FF FF FF	99	0	1,670
E1	FF FF D7	179	1	5,227
E2	FF FF B3	146	1	3,479
E3	FF FF 8F	81	1	1,518
E4	FF FF 6B	52	2	914
E5	FF FF 47	84	2	1,436
E6	FF FF 23	37	2	771
E7	FF FF 00	72	1	3,433
E8	A7 3F 00	188	0	8,468
E9	9F 37 00	176	0	7,997
EA	93 2F 00	184	0	9,943
EB	87 23 00	189	4	10,137
EC	4F 3B 27	348	22	23,573
ED	43 2F 1B	398	19	24,334
EE	37 23 13	530	29	62,747
EF	2F 1B 0B	395	23	46,284
F0	00 00 53	21	5	350
F1	00 00 47	116	8	23,409
F2	00 00 3B	101	8	13,837
F3	00 00 2F	110	9	20,704
F4	00 00 23	128	10	19,670
F5	00 00 17	61	7	17,667
F6	00 00 0B	56	0	8,074
F7	00 00 00	6	1	4,632
F8	FF 9F 43	24	0	199
F9	FF E7 4B	38	0	1,747
FA	FF 7B FF	7	0	61
FB	FF 00 FF	0	0	0
FC	CF 00 CF	5	0	13
FD	9F 00 9B	16	0	248
FE	6F 00 6B	13	0	194
FF	A7 6B 6B	0	0	0

 

Spoiler

And, this list is after I ran my Palette Reduction process:


Index	Color	Patches	Flats	Pixels
00	00 00 00	1,040	23	168,128
01	1F 17 0B	1,067	48	190,474
02	17 0F 07	870	24	128,134
03	4B 4B 4B	622	27	25,650
04	FF FF FF	353	1	27,538
05	1B 1B 1B	1,039	53	111,890
06	13 13 13	1,015	28	90,717
07	0B 0B 0B	808	13	47,949
08	07 07 07	494	7	40,565
09	2F 37 1F	416	33	42,240
0A	23 2B 0F	364	29	40,421
0B	17 1F 07	272	15	19,605
0C	0F 17 00	139	8	8,028
0D	4F 3B 2B	587	27	46,448
0E	47 33 23	618	34	89,956
0F	3F 2B 1B	559	33	82,540
10	FF B7 B7	84	1	494
11	F7 AB AB	239	0	2,448
12	F3 A3 A3	210	2	1,714
13	EB 97 97	230	1	2,102
14	E7 8F 8F	238	2	4,041
15	DF 87 87	253	2	4,920
16	DB 7B 7B	274	3	7,498
17	D3 73 73	302	3	7,092
18	CB 6B 6B	364	3	7,919
19	C7 63 63	357	3	13,096
1A	BF 5B 5B	397	3	9,946
1B	BB 57 57	425	3	13,073
1C	B3 4F 4F	479	3	19,130
1D	AF 47 47	496	3	12,849
1E	A7 3F 3F	558	3	23,887
1F	A3 3B 3B	505	4	8,965
20	9B 33 33	612	5	23,057
21	97 2F 2F	633	2	12,425
22	8F 2B 2B	703	4	16,474
23	8B 23 23	686	4	23,884
24	83 1F 1F	717	7	18,486
25	7F 1B 1B	722	7	25,057
26	77 17 17	709	8	21,758
27	73 13 13	611	5	23,390
28	6B 0F 0F	712	10	30,950
29	67 0B 0B	673	8	32,049
2A	5F 07 07	599	8	25,316
2B	5B 07 07	664	8	29,110
2C	53 07 07	700	10	29,161
2D	4F 00 00	884	13	70,498
2E	47 00 00	559	12	29,240
2F	43 00 00	1,026	17	158,446
30	FF EB DF	197	4	4,288
31	FF E3 D3	236	3	4,105
32	FF DB C7	277	3	5,223
33	FF D3 BB	253	5	2,408
34	FF CF B3	385	5	5,713
35	FF C7 A7	404	6	5,292
36	FF BF 9B	431	4	5,609
37	FF BB 93	447	5	7,316
38	FF B3 83	489	4	7,238
39	F7 AB 7B	595	3	9,879
3A	EF A3 73	562	4	19,360
3B	E7 9B 6B	645	4	14,441
3C	DF 93 63	671	5	22,171
3D	D7 8B 5B	707	4	21,460
3E	CF 83 53	731	5	20,685
3F	CB 7F 4F	712	8	12,599
40	BF 7B 4B	821	5	29,839
41	B3 73 47	936	6	29,539
42	AB 6F 43	909	8	27,631
43	A3 6B 3F	974	15	32,291
44	9B 63 3B	1,103	15	41,475
45	8F 5F 37	1,170	23	49,350
46	87 57 33	1,147	31	51,561
47	7F 53 2F	1,185	35	44,288
48	77 4F 2B	1,209	40	79,680
49	6B 47 27	1,301	56	95,066
4A	5F 43 23	1,295	45	111,793
4B	53 3F 1F	1,303	48	105,024
4C	4B 37 1B	1,368	67	129,144
4D	3F 2F 17	1,331	62	118,292
4E	33 2B 13	1,360	68	215,537
4F	2B 23 0F	1,338	59	211,643
50	EF EF EF	416	5	18,076
51	E7 E7 E7	387	3	10,318
52	DF DF DF	368	3	8,839
53	DB DB DB	436	2	7,165
54	D3 D3 D3	409	5	11,379
55	CB CB CB	474	4	18,028
56	C7 C7 C7	416	3	9,789
57	BF BF BF	510	4	18,367
58	B7 B7 B7	464	3	20,704
59	B3 B3 B3	583	4	18,018
5A	AB AB AB	541	6	13,277
5B	A7 A7 A7	582	4	13,596
5C	9F 9F 9F	684	11	25,059
5D	97 97 97	581	9	10,067
5E	93 93 93	663	13	25,879
5F	8B 8B 8B	709	20	29,449
60	83 83 83	724	17	25,828
61	7F 7F 7F	865	20	45,425
62	77 77 77	929	21	74,098
63	6F 6F 6F	832	23	59,317
64	6B 6B 6B	952	31	51,695
65	63 63 63	920	38	68,520
66	5B 5B 5B	978	37	54,792
67	57 57 57	973	49	66,945
68	4F 4F 4F	1,038	43	63,424
69	47 47 47	971	50	51,349
6A	43 43 43	1,084	45	96,904
6B	3B 3B 3B	1,083	41	61,178
6C	37 37 37	1,027	54	69,594
6D	2F 2F 2F	1,122	60	120,885
6E	27 27 27	1,016	60	169,583
6F	23 23 23	1,023	45	106,719
70	77 FF 6F	50	0	1,509
71	6F EF 67	87	0	1,443
72	67 DF 5F	114	0	2,308
73	5F CF 57	140	0	3,292
74	5B BF 4F	162	0	3,369
75	53 AF 47	190	0	4,875
76	4B 9F 3F	200	3	5,640
77	43 93 37	215	2	5,489
78	3F 83 2F	276	3	7,869
79	37 73 2B	295	6	7,864
7A	2F 63 23	316	6	12,519
7B	27 53 1B	334	7	13,398
7C	1F 43 17	326	11	17,288
7D	17 33 0F	271	12	18,862
7E	13 23 0B	414	23	21,613
7F	0B 17 07	248	10	9,970
80	BF A7 8F	640	4	34,798
81	B7 9F 87	610	4	17,679
82	AF 97 7F	719	4	25,700
83	A7 8F 77	756	4	27,419
84	9F 87 6F	752	9	26,527
85	9B 7F 6B	659	10	17,210
86	93 7B 63	775	14	30,712
87	8B 73 5B	734	12	30,191
88	83 6B 57	804	21	43,543
89	7B 63 4F	791	18	37,477
8A	77 5F 4B	833	27	51,671
8B	6F 57 43	904	34	89,120
8C	67 53 3F	871	46	114,769
8D	5F 4B 37	909	46	127,052
8E	57 43 33	866	50	97,806
8F	53 3F 2F	894	48	103,616
90	9F 83 63	650	5	18,943
91	8F 77 53	581	10	15,126
92	83 6B 4B	664	14	23,149
93	77 5F 3F	678	22	33,468
94	67 53 33	750	28	32,487
95	5B 47 2B	762	38	90,583
96	4F 3B 23	862	55	65,663
97	43 33 1B	1,059	58	107,733
98	7B 7F 63	498	10	32,216
99	6F 73 57	515	12	51,686
9A	67 6B 4F	531	19	45,580
9B	5B 63 47	560	21	94,107
9C	53 57 3B	581	31	87,258
9D	47 4F 33	576	30	63,290
9E	3F 47 2B	614	40	69,299
9F	37 3F 27	676	42	60,468
A0	FF FF 73	183	2	11,362
A1	EB DB 57	232	4	11,330
A2	D7 BB 43	303	5	16,026
A3	C3 9B 2F	314	5	17,354
A4	AF 7B 1F	408	5	29,371
A5	9B 5B 13	477	5	24,488
A6	87 43 07	522	5	26,483
A7	73 2B 00	509	4	25,294
A8	FF FF FF	0	0	0
A9	FF DB DB	108	1	560
AA	FF BB BB	141	1	614
AB	FF 9B 9B	136	1	614
AC	FF 7B 7B	185	4	1,079
AD	FF 5F 5F	243	2	1,787
AE	FF 3F 3F	252	2	2,763
AF	FF 1F 1F	284	3	3,486
B0	FF 00 00	395	3	7,949
B1	EF 00 00	466	6	11,890
B2	E3 00 00	532	6	18,515
B3	D7 00 00	562	6	20,271
B4	CB 00 00	604	7	27,362
B5	BF 00 00	677	8	36,207
B6	B3 00 00	700	11	44,132
B7	A7 00 00	630	10	40,155
B8	9B 00 00	718	13	61,793
B9	8B 00 00	750	15	64,579
BA	7F 00 00	731	17	62,189
BB	73 00 00	694	14	55,206
BC	67 00 00	700	12	73,777
BD	5B 00 00	623	12	61,131
BE	4F 00 00	0	0	0
BF	43 00 00	0	0	0
C0	E7 E7 FF	34	0	1,062
C1	C7 C7 FF	38	0	957
C2	AB AB FF	31	0	857
C3	8F 8F FF	26	0	988
C4	73 73 FF	50	0	1,065
C5	53 53 FF	57	0	587
C6	37 37 FF	58	1	549
C7	1B 1B FF	43	1	458
C8	00 00 FF	79	1	1,354
C9	00 00 E3	109	1	3,566
CA	00 00 CB	129	1	4,304
CB	00 00 B3	138	5	8,131
CC	00 00 9B	126	10	7,771
CD	00 00 83	139	10	10,270
CE	00 00 6B	144	11	16,930
CF	00 00 53	131	11	18,494
D0	FF FF FF	0	0	0
D1	FF EB DB	164	0	3,551
D2	FF D7 BB	253	0	3,450
D3	FF C7 9B	239	0	3,545
D4	FF B3 7B	136	0	1,474
D5	FF A3 5B	217	0	2,952
D6	FF 8F 3B	184	0	3,029
D7	FF 7F 1B	186	0	3,878
D8	F3 73 17	202	0	3,538
D9	EB 6F 0F	233	0	4,537
DA	DF 67 0F	220	0	5,118
DB	D7 5F 0B	259	0	5,129
DC	CB 57 07	255	0	9,061
DD	C3 4F 00	221	0	9,099
DE	B7 47 00	238	0	6,846
DF	AF 43 00	251	0	5,527
E0	FF FF FF	0	0	0
E1	FF FF D7	179	1	5,227
E2	FF FF B3	146	1	3,479
E3	FF FF 8F	81	1	1,518
E4	FF FF 6B	52	2	914
E5	FF FF 47	84	2	1,436
E6	FF FF 23	37	2	771
E7	FF FF 00	72	1	3,433
E8	A7 3F 00	188	0	8,468
E9	9F 37 00	176	0	7,997
EA	93 2F 00	184	0	9,943
EB	87 23 00	189	4	10,137
EC	4F 3B 27	348	22	23,573
ED	43 2F 1B	398	19	24,334
EE	37 23 13	530	29	62,747
EF	2F 1B 0B	395	23	46,284
F0	00 00 53	0	0	0
F1	00 00 47	116	8	23,409
F2	00 00 3B	101	8	13,837
F3	00 00 2F	110	9	20,704
F4	00 00 23	128	10	19,670
F5	00 00 17	61	7	17,667
F6	00 00 0B	56	0	8,074
F7	00 00 00	0	0	0
F8	FF 9F 43	24	0	199
F9	FF E7 4B	38	0	1,747
FA	FF 7B FF	7	0	61
FB	FF 00 FF	0	0	0
FC	CF 00 CF	5	0	13
FD	9F 00 9B	16	0	248
FE	6F 00 6B	13	0	194
FF	A7 6B 6B	0	0	0

 

 

The image below is a shot of the single image editor. The highlighted entry in the dropdown is a tool that does the same process, but on a single image.

 

PalFix.JPG

 

So, it's possible to do. But, it makes a lot more sense to have this process built into the source port, I think. That way, you could avoid having to provide all the IWAD resources in your mod. This is the main reason I have not proceeded further. It just seemed to have too many issues. Now, if you were doing a full TC with completely new monsters, a new palette is the way to go. Otherwise, it could be done, but I'd suggest using the same patch system used to generate Doom upgrades (you know, the programs that let you upgrade to Doom 1.9 from 1.7, or downgrade from Doom 1.666 to Doom 1.2). That would let you provide the necessary modified original resources.

 

Come to think of it, if you're adding sprites, you'd have to release all the original sprites anyway, due to the bug in the way Doom handled sprite patch replacements. So, you may want to ask around about what the community thinks about that.

 

 

Edited by kb1

Share this post


Link to post

Back to Saturn X is I think probably the biggest project to date that squeezed out more colors by eliminating duplicates. Ancient Aliens does this too, though more liberally by combining some near duplicates too, but Ancient Aliens also shuffles the whole palette around too, unlike BTSX which I think keeps positions mostly intact.

 

For a while I was using a modifier version of three Ancient Aliens palette for my own personal, growing resource pack, and after a while it just became such a hassle converting try new resource I added to the new palette structure that I gave up and went back to using a modified default doom palette. I lost some extra color ranges in the process, but it's not enough of an issue for my purposes to want to deal with all the conversion every time I add a new graphic or sprite.

Share this post


Link to post

It's been a while since I've looked, but Ancient Aliens adds something like 55 colors to the palette by removing the totally redundant indexes, making some compromises where colors are somewhat near, and just outright removing colors that are rarely used in the base game (like the magenta range, which gets replaced with an even more magenta range anyway...). I believe I had some ideas to optimize it a bit further but late enough in the project that there wasn't much to gain from it (since I wasn't about to go back and edit 20+ levels to add a little bit of a new color here and there).

 

And yes, it can be quite a pain to work with, but I believe you can just "install" it as one of Slade's palettes and do quick batch conversions any time you add in resources - which means no matter how large the number of resources added, it's just a couple of extra clicks, as long as you have the base palette of the resource you're sourcing from installed as well (typically just the Doom palette, but occasionally something else).

Share this post


Link to post
Just now, Tango said:

Back to Saturn X is I think probably the biggest project to date that squeezed out more colors by eliminating duplicates. Ancient Aliens does this too, though more liberally by combining some near duplicates too, but Ancient Aliens also shuffles the whole palette around too, unlike BTSX which I think keeps positions mostly intact.

 

For a while I was using a modifier version of three Ancient Aliens palette for my own personal, growing resource pack, and after a while it just became such a hassle converting try new resource I added to the new palette structure that I gave up and went back to using a modified default doom palette. I lost some extra color ranges in the process, but it's not enough of an issue for my purposes to want to deal with all the conversion every time I add a new graphic or sprite.

BTSX's palette optimizes out a lot of near-duplicates as well, but it was much more of an unplanned piecemeal affair than Ancient Aliens' palette probably was — I started out trying to change as little as possible, then as time went on it was another thing here and another thing there, figuring things out as I went, over the course of a few years.

 

BTSX's palette is admittedly something of a disorganized mess because of that, particularly compared with Ancient Aliens' neatly organized palette, since I was always trying to avoid mucking up what was already done. This is why there are things like a completely fullbright purple range, a holdover from when there were only 5 purples like in Doom's original palette. On one hand, this is useful for some special effects, but on the other hand it means that the nice big 16-shade purple ramp is only barely usable for structural textures.

 

There are some useful and possibly-not-well-known(?) palette optimizations worth noting in BTSX, though, like how you can chop out most of the bright yellows (there are a lot of them that are basically indistinguishable and are only ever used on some projectile sprites), and adjust the remaining ones to consolidate them from several completely different yellowish hues into one coherent ramp that colormaps more smoothly. You can also dramatically improve Doom's red ramp without having to steal any colors from elsewhere in the palette for it, by increasing the contrast on its lower half so that it fades down toward black, instead of leveling out to a medium-red like it inexplicably does in Doom's original palette.

Share this post


Link to post
2 hours ago, kb1 said:

Color usage stats are in the spoilers:


FB	FF 00 FF	0	0	0
FC	CF 00 CF	5	0	13
FD	9F 00 9B	16	0	248
FE	6F 00 6B	13	0	194
FF	A7 6B 6B	0	0	0

 

I want to point out that for index 255, the lack of use is an error, since I have found one graphic that should have used it. But it was used as the transparent color in id's image import tool.

 

 

 

Speaking of transparent color, a reminder for palette optimizers out there: ZDoom needs one (because it replaced the drawing routines that only worked with patches to generic drawers that can handle any image format, so there's no longer an offset-based pixel skipping built-in), and will sacrifice a palette index for that, preferentially a duplicate color if one is found. My usual recommendation is to put black at both index 0 and index 255.

Share this post


Link to post

Some things to consider that may not be immediately obvious:

  • Light diminishing, as esselfortium mentions. When you add a color, you must also consider how that color will fade in the dark.
  • Translucency. If you add a blue/green for a fireball, you might need to consider how it will look in front of, say, a red background. The quality of translucency is directly related to the availability of blend colors.

I am starting to lean towards 32-bit rendering. 8-bit Doom translucency is rarely great, and is sometimes horrible, due to the imbalanced palette. Trying to balance the colors will definitely help a lot, but will never produce wonderful results. 256 colors is just not enough for high-quality color fading and blending. The only other way to do better is to employ dithering, which can make a huge difference. But it can look unpleasant, unless great care is taken.

Share this post


Link to post
52 minutes ago, Gez said:

I want to point out that for index 255, the lack of use is an error, since I have found one graphic that should have used it. But it was used as the transparent color in id's image import tool.

 

Speaking of transparent color, a reminder for palette optimizers out there: ZDoom needs one (because it replaced the drawing routines that only worked with patches to generic drawers that can handle any image format, so there's no longer an offset-based pixel skipping built-in), and will sacrifice a palette index for that, preferentially a duplicate color if one is found. My usual recommendation is to put black at both index 0 and index 255.

Interesting about ZDoom's need for a transparent color. Seems to me like a different approach could have eliminated that need. I guess, at the time, all palettes could be guaranteed to have dups, so it must have seemed like a non-issue.

 

It's possible that my tool shit the bed on index 255. Can't say right now. Its use in a patch should be an error, but I think vanilla Doom can actually handle it, since it doesn't really do anything special with the marker. I can't remember if 255 is used in a flat, but I seem to remember that there were a few in the patches. In those numbers I posted, I may have stripped out the FF's upon loading each resource.

 

Here's another screen that does a bit more analysis, and finds the near-dups:

PalUse3.JPG.dba4a33bb66368ae1bdf841e02dee831.JPG

 

I hope to be able to release this stuff when I can get it together. The middle list shows the near-dups, with peach colors highlighted. It determines that colors 0x36 and 0xD3 differ by 8 (out of 768).

 

7 dups + 14 near-dups that differ by 8 or less = 21 new colors, with very little quality loss. The standard reds all differ by 12.

 

The lower section searches the entire color space and displays a predetermined count of colors that differ the most from all the colors in the Doom palette. In other words, out of all possible colors in 24-bit truecolor, those are the colors most unrepresented by the Doom palette, that also differ from each other by the largest amount affordable in a group of 1,948 colors.

 

Now, if we were to remove the dups and the 64 near-dups, that's 71 free slots. If I click the 'Reduce' button, the missing color count is reduced. If I do this enough times, hopefully I can find 71 new colors to put in those slots, that will follow the following rules:

1. We want to be able to represent the Doom images as closely as possible.

2. We want to "even out" the palette, providing as many new colors as possible, to hopefully represent everything missing from Doom's palette.

 

When I continue to reduce, I end up with these 71 colors (as PNG, unlike the previous pictures, so the colors are exact):

Final71.PNG.dca00bdef711d1ee0370d5c64a3fd2f9.PNG

 

Honestly, I don't think the code worked right. There's tons of blue/green there, and some of them look very similar. Yes, blue/green is very unrepresented in Doom. And, yes, it does provide some nice greens that are sorely missing. Finally, there's a few new purples, a single orange, and some green/yellow stuff. Maybe it did work. It's an interesting area of study, but it takes *way more* time than I put into it. Still, these 71 colors would make a huge difference in transparency maps, and fade-to-black colors.

 

Funny thing is, human sight does not track linearly with RGB indexes. I'd love to see this palette, while using the plasma gun with transparent plasma. Or, some underwater transparent-type thing. A palette like this would do wonders for those two situations!

 

(or, just go truecolor... :)

 

 

 

Edited by kb1

Share this post


Link to post

(Sorry, triple post). I think I know what went wrong above. The 1,948 colors were correct, but when the program reduced it to 71 colors, it forgot to grab colors that were a far apart as possible.

 

Here's the original 1,948 colors, in PNG format, if anyone wants to play with them. Eventually I'll fix my reducer, and produce the proper 71 colors.

Original.PNG.0dacbb4be079909d9ce08c593bcb98ea.PNG

Share this post


Link to post

Good luck changing anything without breaking hardcoded shit like automap. And many source ports have more of it.

 

That's all I wanted to say. Yeah.

Share this post


Link to post
3 hours ago, Da Werecat said:

Good luck changing anything without breaking hardcoded shit like automap. And many source ports have more of it.

 

That's all I wanted to say. Yeah.

Oh, that's right - that's another consideration. I actually blame the source ports for this one: Mods should be able to inform the port about such changes, and the ports should, at least optionally, use the mod's color scheme for the automap, and maybe for other elements as well, like menu and HUD text.

Share this post


Link to post

Not sure if this will be helpful, but this sort of represents my thoughts on the Doom palette, after messing around with a few custom palettes.

 

bQHdQcB.png

 

Primary: The hard duplicates that can be replaced without any degrading of graphics.

 

Secondary: Soft duplicates and rarely used colours, that should have minimal impact.

 

Tertiary: Potential ranges that can be reduced in size (Pinks and Greys) or replaced (Others) but may have noticable impact on vanilla assets. Worth considering if you intend to use entirely custom textures.

 

Note: The Blue range is sort of isolated from the rest of the palette, and you can perform quite drastic hue and saturation shifts on it, without it affecting anything else. (Which can be quite handy!)

 

---

 

I think transparency is a minor issue, since there are bigger problems in the Doom palette. Those being the Pink and Red ranges which degrade into brown quite badly. The Reds are fairly easy to fix by replacing 4 redundant entries with dark reds, but the Pinks are more problematic, and require an additonal range of desaturated pinks, creating something like this:

 

qRus4y4.png

 

The BTSX palette addresses this slightly differently, in that the colormap was edited to spread a quite saturated range of deep pinks. However, another elegant solution can be found in Sunlust's palette, which desaturated the Pink range itself to create a smooth gradient.

 

 

 

 

Edited by Urthar

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×