I am using a slightly different method for OpenGFX+ Trains.
I use a material index and compositor block in a similar fashion for the 1cc and 2cc but do not mix the background colour into it.
I set the material colour to a central value in the 8-bit colour range.
This produces 2 files with alpha in the correct 8-bit colour range.
This allows me to do a few post-processing tasks; making the 8-bit CC masks for 32bpp and also creating 8bpp sprites.
Using GIMP, I then convert each mask to a single colour using an index file, for example to get the 1cc mask for 32bpp I use, but you can change this to lighten or darken the sprite's CC colour.
Code:
GIMP Palette
Name: ttd-newgrf-32cc1only
Columns: 16
#
20 52 124 Index 200
Finally, I add 3 images together:
1. The backround colour (magic blue)
2. The 1cc image
3. The 2cc image
This gives me an 8-bit image mask for the 32bpp sprites, as shown below.
For the 8bpp sprites, I again use the 2 image files created in the compositor and the image without ground shadows (another compositor block, the shadows look awful in 8bpp within OpenTTD) and pass them through GIMP. This time I use a colour index file containing all the 8bpp cc colours
Code:
GIMP Palette
Name: ttd-newgrf-cc1only
Columns: 16
#
8 24 88 Index 198
12 36 104 Index 199
20 52 124 Index 200
28 68 140 Index 201
40 92 164 Index 202
56 120 188 Index 203
72 152 216 Index 204
100 172 224 Index 205
Now what I do here is that I take the sprite image, convert it to DOS indexed without any special colours (i.e. flashing colours etc), this does not give me a final image because the CC magic colours are not good after this process. So, I now take the converted masks and lay them upon this image and finally merge down.
This gives a nice 8bpp sprite with the correct cc colourings, as shown in my example below.
Yes, quite a bit of post-processing in GIMP and maybe too complex for some of the more structural sprites, but works great for vehicles.
