How to Save PCX with Custom Palettes in GIMP
This guide explains the exact settings and workflow required to export legacy ZSoft PCX bitmap files with custom color palettes using GIMP. Because the PCX specification relies on indexed color tables for legacy hardware and retro software pipelines, properly configuring GIMP's color mode and palette settings before export ensures your files maintain exact color mapping and full compatibility.
Step 1: Convert the Image to Indexed Mode
The ZSoft PCX format stores palette data within an indexed color table rather than standard RGB channels. To prepare the image:
- Open your image in GIMP.
- Navigate to the top menu and select Image > Mode > Indexed....
- In the Indexed Color Conversion dialog, locate the Colormap section.
Step 2: Apply the Custom Palette Settings
To force GIMP to use your specific palette instead of generating an automatic one:
- Select the Use custom palette radio button.
- Click the palette preview button to open the palette selection list.
- Choose your imported custom palette. Ensure your palette does not exceed 256 colors, as legacy 8-bit PCX files support a maximum of 256 indexed entries (or 16 colors for 4-bit EGA formats).
- Uncheck Remove unused and duplicate colors from colormap if you need the palette structure and index order to remain identical to your source specification.
- In the Dithering section, set Color dithering to None to preserve exact pixel-to-palette assignments, or select Floyd-Steinberg (normal) if you need smooth transitions across limited colors.
- Click Convert.
Step 3: Export the PCX File
Once your image mode is indexed to your chosen palette, save the file using GIMP's export pipeline:
- Go to File > Export As....
- Set the file extension to
.pcxin the filename, or expand Select File Type (By Extension) at the bottom and select ZSoft PCX image. - Click Export.
GIMP automatically embeds the active indexed colormap directly into the 256-color palette block at the end of the PCX file (or inside the header for 16-color files), preserving your custom color palette for legacy applications.