Home
Contact Us

ARTICLES

Level-safe Palette Conversions
By
Matt Hallaron

Many DF level and component editors out there have had problems with palettes. Sometimes it's annoying little transparent holes in a graphic, trying to use the color black. Sometimes it's extraneous brite-mapped pixels on a wax that only show up once it's placed in a low-light secotor. Sometimes it's a texture that looks great in one level, but can't be used in another because it uses a different palette.

I want to show you a procedure that can end all that a procedure that converts images into a form that is safe to use in all DF palettes and under all lighting conditions.

What you need: An image editing program that loads, saves, and edits palettes. (I usually use Photoshop, but I know this can work in Paint Shop Pro 3 as well.) You can also use these graphics:


SEC-SML.GIF
Image using the secbase palette.
   
DEF-NOBR.GIF
Image using a default, no-brite palette.

Take a look at the second image. It shows the entire arrangement of this specialized palette. With the exception of the Color 0, all of the brite-mapped colors, the level-custom colors, and the special colors have been set to yellow. Color 0 has been set to bright purple. The remaining colors are the colors that are consistent throughout all of the Dark Forces levels (and briefings.) If you make your image use just these colors, it will work in any level.

The first bit of prep work you need to do is to go into your image editing program and load up these images. Find the colors/palettes section of the image editing program and save the palettes of each image (in Photoshop: Image, Mode, Color Table -> Save; in Paint Shop Pro 3: Colors, Save Palette). You should probably save the palettes in the image editor's native format (in PS, it's .ACT; in PSP3, it's .PAL (JASC PAL)- notice this is not the same
as DF's .PAL.
)

once that is done, you are ready to convert your images to be level-safe.

  • Select what you want to be converted. If possible, include only the parts you want solid, do not include in your selection the parts you want transparent.
  • Copy.
  • Create a new document the size of what you copied.
  • Select the color to be the bright purple of DEF-NOBR's
    Color 0 (RGB: 255, 0, 255). If that file is open, you can use the eyedropper tool.
  • Fill the new document with that color purple.
    Paste your image into the new document
    .
All transparent parts should be purple. If there are any non-purple parts that you want transparent, use a pencil tool to color them in purple. Any remaining black pixels will be solid. You should also check the edges to fix any anti-aliasing problems that may have occurred.
  • You now need to convert the image into an indexed color mode, using the default-nobrite palette.
    • PS: Image, Mode, Indexed color -> Custom, Load [DEF-NOBR.ACT]
    • PSP3: Colors, Load Palette
      [DEF-NOBR.PAL]

The image editing program should now automatically do the best match of the colors in your image to the default-nobrite palette.
  • Now you load the secbase palette into your image.
    • PS: Image, Mode, Color Table -> Load [SEC-SML.ACT]
    • PSP3: Colors, Load Palette [SEC-SML.PAL] - Make sure you check "Maintain indexes"
  • Save your file as a .BMP/.PCX/.PICT file and it's ready to convert to DF!
One way that I check to see how safe my image is is to load in another default-checking palette used here:


DEF-CHK.GIF
Image using a default checking palette.

With this palette, all of the brite-mapped colors turn cyan, all the custom colors turn yellow, while the background turns purple. This way, I can check my images, and see if there are any potential problem areas and fix them.

   
The guard on the left will have many problems: he will have gaps in his neck, hands, and helmet; if he's placed in a dark sector, parts of his pants will glow bright red; and if he's put in a palette other than secbase (or equivalent), parts of his helmet, face, and gloves may be discolored. The guard on the right, however, will look good in any environment.

The colors here can of course be modified if you modify the palettes. You can also modify the technique so that brite-maps are included, but not the custom colors (or vice-verse.) You could even make something to convert to ONLY the brite mapped colors if you wanted.

The downside to all this is that your image could loose some of its depth, since it is using less colors. Therefore, this technique may not be for everyone, especially with custom textures. But for making general custom components, especially waxes and fmes, this can be extremely useful.

If you are fortunate enough to use Photoshop, I suggest you set this procedure to an Action, so you can quickly use it to convert your files.

One last thing: when you are converting your image into a Dark Forces format, if at all possible do a straight conversion - do not specify any palette to use. Your image has already got the correct color indexes, making palette conversion unnecessary. You also don't have control over how the ->DF program will convert the colors. So it could really screw things up.