Fact-checked by Grok 2 weeks ago

PCX

The PCX (PiCture eXchange) format is a raster image file format developed by ZSoft Corporation in 1985 for use with its PC Paintbrush graphics software on MS-DOS systems. It stores bitmap images with support for monochrome, indexed color (up to 256 colors), and 24-bit RGB color depths, employing run-length encoding (RLE) for lossless compression to reduce file sizes efficiently for simple graphics. The format features a fixed 128-byte header that includes metadata such as image dimensions, bit depth, color planes, and an optional 16-color EGA palette, followed by the encoded image data and, in later versions, a 256-color VGA palette at the end of the file. PCX gained widespread adoption in the and early due to its integration with early PC graphics applications, including Microsoft's bundling of with Windows, making it a for , screenshots, and on IBM-compatible PCs. It evolved through several versions—from the initial 2.5 release supporting basic monochrome and 4-bit color, to version 3.0 in 1991 adding 24-bit color support and enhanced palettes—to accommodate advancing display technologies like EGA and VGA. The format's RLE compression processes scanlines plane by plane (e.g., for RGB separation in 24-bit images), repeating bytes to handle runs of identical pixels, though it performs poorly on complex, high-detail images compared to modern alternatives. A related multi-page variant, DCX, emerged for fax applications, allowing multiple PCX images in a single file, but PCX itself remained single-image only with a maximum of 64,000 by 64,000 pixels. By the mid-1990s, PCX was largely supplanted by more versatile formats like , , and , rendering it obsolete for contemporary use, though it persists in legacy software, products, and archival contexts. Its documentation, including ZSoft's official technical reference manual, ensures partial sustainability for , despite no formal standardization body.

History and development

Origins

The PCX (PiCture eXchange) file format was developed in 1985 by ZSoft Corporation, a software company founded in 1980 and based in . Created as the native format for ZSoft's PC Paintbrush application on , PCX emerged during the early era of personal computing when IBM-compatible PCs dominated the market. Designed as a simple and efficient raster image format, PCX was tailored for the hardware limitations of the time, particularly supporting palette-indexed images suitable for color displays like CGA and EGA, which offered limited palettes of 4 to 16 colors. This focus on compactness and quick rendering made it ideal for exchanging graphics in resource-constrained environments, predating the rise of graphical user interfaces like Windows. Initial adoption of PCX was closely linked to ZSoft's graphics tools, which served business and technical applications on systems, including image handling for early and design workflows. The format's release alongside PC Paintbrush version 2.5 positioned it as one of the earliest proprietary standards for image exchange, facilitating among DOS-based software before more universal formats emerged.

Versions and evolution

The PCX format originated in 1985 with version 0, corresponding to ZSoft's 2.5, which supported basic monochrome images and up to 16 colors, aligned with the limitations of early PC graphics adapters like CGA and early EGA hardware. This initial version incorporated (RLE) compression from the outset to optimize storage on floppy disks, achieving compression ratios of 40-70% for simple 16-color images by encoding repeated bytes efficiently. Subsequent updates addressed evolving graphics hardware, with version 2 (PC Paintbrush 2.8) introducing palette information to enable modifiable EGA palettes for enhanced color control beyond fixed CGA sets. Version 3, also from PC Paintbrush 2.8, omitted the palette for files without it, streamlining storage for EGA-compatible images while maintaining . These changes reflected the transition from CGA's 4-color displays to EGA's 16-color capabilities, allowing PCX to adapt to the growing prevalence of enhanced graphics cards in the late 1980s. The format reached its peak with version 5 in 1991, tied to PC Paintbrush 3.0, which added support for VGA's 256-color palettes and 24-bit through a multi-plane structure using three 8-bit planes for red, green, and blue channels, enabling up to 16 million colors. This evolution culminated in PCX's broad adoption for applications, including scanning and faxing, as it accommodated SuperVGA extensions. PCX's decline began in the early 1990s with the rise of Windows, which favored the native for its application, rendering PCX less essential despite its prior bundling via OEM deals. By the mid-1990s, superior alternatives like for and for lossless web use overshadowed PCX's limitations in efficiency and multi-image support, leading to its obsolescence.

Supported image types

Color modes

The PCX format employs a palette-indexed approach, where pixel values act as indices into a color containing RGB entries, rather than storing direct color values; this design optimized storage and display for the constrained hardware of early personal computers, such as those with buses. All single-plane modes in PCX rely on this indexing to map pixel data to colors defined in the palette. The monochrome mode operates at 1 bit per pixel, supporting only two colors—typically —for simple graphics like line art and text, which were prevalent in early applications on CGA-compatible systems. In this configuration, each bit directly determines the pixel's state (on or off), drawing from a fixed two-entry palette without requiring additional color data storage. A 2-bit per pixel mode provides 4 colors, suitable for early CGA graphics, and features a palette in the header to define the colors. This mode packs four pixels across two bytes in single-plane configuration. A 4-bit per mode provides 16 colors, aligning with the capabilities of CGA and EGA graphics adapters during the , and commonly features a 48-byte EGA palette embedded in the file structure to define the available colors. This mode efficiently encodes two pixels per byte in big-endian order, making it suitable for icons, sprites, and low-resolution illustrations of that era. The 8-bit per pixel mode accommodates 256 colors, establishing the standard for VGA mode 13h in the late and early , with the full palette—comprising 768 bytes of RGB values—appended at the file's end for comprehensive color mapping. It represented a key evolution, enabling richer visual content like detailed artwork and photographs adapted to indexed displays, while remaining backward-compatible with lower-depth modes through palette subsetting. Although PCX extensions support multi-plane setups for true-color imaging, the core single-plane modes emphasize palette efficiency for legacy hardware.

Multi-plane configurations

In the PCX format, multi-plane configurations enable higher color depths by dividing pixel data across multiple bit planes, where each plane represents a single bit position across all pixels in a scanline, allowing for packed storage of indexed colors. For instance, 16-color images, commonly associated with EGA graphics, utilize four 1-bit per pixel, with each plane corresponding to one bit in a 4-bit color index (e.g., bits for , , blue, and intensity components), resulting in a total of 16 possible color combinations when combined with a 16-entry palette. This planar arrangement stores data sequentially by plane within each scanline, with the number of planes specified in the file header. For true-color representation, PCX supports 24-bit RGB images through three 8-bit planes, one dedicated to each color (red, , and ), enabling up to 16.7 million colors without relying on a palette. These planes are ordered red, then , then , and each scanline's data is encoded separately per plane before proceeding to the next. This configuration, introduced in later versions of the format, provides direct color storage but is less efficient for palette-based workflows common in early computing. Multi-plane configurations in PCX introduce added complexity in file decoding and storage, as data must be processed plane-by-plane rather than pixel-by-pixel, often requiring padding to even byte boundaries and careful handling of scanline boundaries. Such setups are relatively rare outside of 24-bit true-color modes, with most legacy PCX files favoring simpler single-plane indexed s for compatibility and efficiency.

File format specification

Header structure

The PCX file header is a fixed-size structure of 128 bytes located at the beginning of every PCX file, providing essential for the image, including identification, version, dimensions, resolution, color plane details, and an optional embedded palette. This header ensures compatibility across different implementations of the format developed by ZSoft, with all multi-byte integer values stored in little-endian byte order. The header's byte-by-byte layout is as follows:
OffsetSize (bytes)Field NameDescription
01ManufacturerIdentifier byte, always set to 0x0A (decimal 10) to indicate a ZSoft PCX file.
11VersionVersion number of the PC Paintbrush software used to create the file: 0 for version 2.5, 2 for 2.8 with palette information, 3 for 2.8 without palette, 4 for Paintbrush for Windows, or 5 for version 3.0 and later (supporting 24-bit color).
21EncodingEncoding method: 1 indicates standard run-length encoding (RLE), while 0 denotes uncompressed data (unofficial and rarely used).
31BitsPerPixelNumber of bits per pixel per plane, typically 1, 2, 4, or 8.
42XminMinimum X coordinate of the image (usually 0), as a 16-bit unsigned integer.
62YminMinimum Y coordinate of the image (usually 0), as a 16-bit unsigned integer.
82XmaxMaximum X coordinate (width minus 1), as a 16-bit unsigned integer.
102YmaxMaximum Y coordinate (height minus 1), as a 16-bit unsigned integer.
122Horizontal DPIHorizontal resolution in dots per inch, often set to the device's DPI but considered unreliable for precise rendering.
142Vertical DPIVertical resolution in dots per inch, similarly unreliable.
1648EGA PaletteOptional 16-color palette for EGA-compatible displays, consisting of 16 RGB triples (3 bytes each: red, green, blue values from 0 to 255), padded with zeros if unused.
641ReservedReserved byte, must be set to 0.
651Number of PlanesNumber of color planes, typically 1 (monochrome or indexed), 3 (RGB), or 4 (CMYK).
662Bytes per LineNumber of bytes per scanline per plane, always even and padded (e.g., to a multiple of 2 or 4) regardless of actual pixel data needs.
682Palette TypePalette interpretation: 1 for color or black-and-white, 2 for grayscale (often ignored in later versions).
702Horizontal Screen SizeHorizontal screen resolution minus 1 in pixels (introduced in PC Paintbrush IV and later; best ignored for compatibility).
722Vertical Screen SizeVertical screen resolution minus 1 in pixels (similarly, introduced later and unreliable).
7454FillerReserved padding bytes to reach 128 bytes total; must all be set to 0, though some implementations may include junk data.
The image dimensions are derived from the bounding box coordinates as width = Xmax - Xmin + 1 and height = Ymax - Ymin + 1, where all values are in . These fields, combined with bits per pixel and number of planes, define the overall color mode, such as 1-bit or 8-bit indexed color.

Image data encoding

The image data in a PCX file follows the 128-byte header and represents the content as a series of scanlines stored from top to bottom. Each scanline consists of data for all color planes sequentially: for a given scanline, the entire line from the first plane is encoded first, followed by the second plane, and so on, up to the number of planes specified in the header. The length of each plane's line is determined by the BytesPerLine value in the header, which is always an even number to ensure byte alignment, and may include padding bytes at the end of each plane's data to reach this length. The pixel data is compressed using a lossless, byte-oriented (RLE) scheme, which is applied independently to each plane within each scanline. In this method, bytes are processed sequentially: if the top two bits of a byte X are set to 1 (i.e., X is in the range 0xC0 to 0xFF), it signals a run code where the repeat count is given by the lowest six bits of X, and the value to repeat is the next byte read from the file; otherwise, if the top two bits are 0 (X in 0x00 to 0xBF), it represents a single literal byte with a count of 1. This encoding reduces file size for runs of identical bytes but introduces minimal overhead for non-repetitive data, typically around 25% larger than uncompressed for random content. For multi-plane images, such as those with 4 planes for 16-color EGA mode, the bits from corresponding positions across the planes are concatenated to form the multi-bit for the . For example, in a 1-bit-per-plane, 4-plane configuration, the bits from planes 0 (least significant bit) through 3 form a 4-bit . The total encoded data for the image spans (Y dimension + 1) scanlines, with each scanline totaling (number of planes × BytesPerLine) bytes after decoding, and is immediately followed by any palette data if present. In rare cases, such as files with encoding byte set to 0 in the header (not officially supported but recognized by some software) or early version 0 files from 2.5, the image data is stored uncompressed as raw bytes without RLE, laid out in the same scanline and plane order. This uncompressed format is uncommon in practice, as standard PCX implementations default to RLE encoding.

Palette storage

In PCX files supporting 16-color modes, such as those used for early EGA graphics, the palette is stored in the file header as a fixed 48-byte consisting of 16 RGB triples, where each component (, , ) is an 8-bit value ranging from 0 to 255 representing intensity levels. This header palette provides the color map for indexed pixel data in low-color configurations, typically for versions 2 through 4 of the format. For 256-color modes, prevalent in VGA-era applications, the palette is stored separately at the end of the file as a 768-byte array of 256 RGB triples, each with 8-bit components from 0 to 255, immediately preceded by a 0x0C byte to mark its location. In this 8-bit indexed mode, pixel values directly correspond to indices in this palette, enabling a full 256-color lookup without header reliance. PCX files in 24-bit true-color mode omit any palette storage, as color information is directly encoded through multiple bit planes (typically three 8-bit planes for , , and ), allowing pixel values to be reconstructed without . Software reading PCX files determines palette usage by examining the header's bits-per-pixel and number-of-planes fields: if bits per pixel is 8 and planes is 1 (indicating 256-color mode), it seeks to the file end to read the 768-byte palette after the 0x0C ; otherwise, for 16-color or fewer modes, it uses the 48-byte header palette, while multi-plane true-color files derive colors directly from the planes without a palette.

Applications and legacy

Software support

The PCX format originated as the native file format for ZSoft Corporation's graphics editing software, first released in 1984 and developed through versions up to 1991, enabling users to create and edit raster images with support for various color depths and (RLE) compression. licensed and bundled a version of PC Paintbrush with in 1990, providing native import and export capabilities for PCX files as part of its basic tools, which helped popularize the format among early Windows users. In modern graphics software, the offers built-in import and export support for PCX files as of 2025, including handling of palettes for modes up to 256 colors, making it suitable for editing legacy images while preserving original . maintains legacy compatibility with PCX through its core file format handlers, allowing users to open, edit, and save PCX images in RGB and modes, though additional plugins may be required for advanced features in newer versions. , a lightweight and converter, provides quick read and write access to PCX files via its native plugins, supporting formats like 1-bit , 8-bit paletted, and 24-bit RGB, with options for and basic editing. For and workflows, FFmpeg includes a dedicated PCX demuxer and encoder in its libavformat and libraries, enabling extraction and encoding of PCX images in formats such as pal8 (8-bit paletted) and rgb24 (24-bit RGB), which facilitates integration into video pipelines or format migrations without loss of RLE-compressed data. supports reading and writing PCX files through its command-line tools and , preserving the original RLE compression during round-trip operations and handling color modes from 1-bit to 24-bit, which is useful for scripted batch conversions in automated pipelines. In efforts, PCX files are commonly handled by emulators like for rendering DOS-era graphics assets and by open-source format libraries such as those in or FFmpeg, which ensure accessibility of archived DOS software images without proprietary dependencies. These tools play a key role in maintaining the readability of PCX-based artifacts from and computing environments.

Use in

The PCX format gained prevalence in during the and , serving as a for DOS-era titles that utilized 320x200 VGA resolution for sprites and backgrounds. Its support for up to 256 colors aligned directly with VGA hardware in mode 13h, enabling efficient rendering of colorful assets without exceeding memory constraints typical of the era. This made PCX particularly suitable for and commercial releases distributed on limited-capacity floppy disks. Notable examples include 's early works, where PCX files stored promotional and development assets; for instance, pre-release screenshots for were distributed as loose PCX files. Similarly, employed PCX through its official EditArt tool, which allowed artists to import and export textures and sprites in the format during development. Apogee Software's titles, such as the series, used PCX for level graphics, with providing full level images in PCX format to Apogee for marketing purposes. The format's (RLE) compression was a key technical fit for floppy-based distribution, as it significantly reduced file sizes for uncompressed 256-color images, facilitating easier sharing and installation on systems with minimal storage. This efficiency, combined with palette-based color indexing, ensured compatibility with VGA displays while keeping assets compact enough for the 1.44 MB floppy limit common in the period. In legacy contexts, PCX persists through modern retro gaming tools and engines that handle or convert the format for preservation and . For example, fan-developed utilities extract and convert PCX assets from classic titles to for compatibility with contemporary modding pipelines, while emulators like support direct loading of PCX files from original game data.

References

  1. [1]
    PiCture eXchange (PCX)
    ### Summary of PCX Versions and Evolution
  2. [2]
    PCX: Summary from the Encyclopedia of Graphics File Formats
    PCX is one of the most widely used storage formats. It originated with ZSoft's MS-DOS-based PC Paintbrush, and because of this, PCX is sometimes referred to as ...
  3. [3]
    ZSoft PCX File Format Technical Reference Manual
    Your modem should be set for 8 data bits, 1 stop bit, and NO parity. Image File (.PCX) Format If you have technical questions on the format, please do not call ...Missing: specification | Show results with:specification
  4. [4]
    PiCture eXchange (PCX)
    ### Summary of PCX Format
  5. [5]
    ZSoft Corporation - IT History Society
    ZSoft Corporation, founded by Mark Zachmann, was a Marietta, Georgia software company in the 1980s known for the PC Paintbrush software and its PCX graphic ...
  6. [6]
    What is a PCX file and how can you open it? - Adobe
    ZSoft published the PCX file in 1985 as the native file format for their PC Paintbrush program. The PCX file became a widely accepted standard format for the MS ...Missing: origins | Show results with:origins
  7. [7]
    Details for: PCX 0 - PRONOM | Search by format
    Apr 29, 2022 · PCX (Personal Computer eXchange) is a type of lossless bitmap image format first released in 1985 and last updated in 1991.Missing: origins | Show results with:origins
  8. [8]
    Definition of PC Paintbrush - PCMag
    A DOS paint program developed by the ZSoft Corporation, Marietta, GA. It was the first popular paint program for the PC, and its PCX bitmapped graphics format ...Missing: history | Show results with:history
  9. [9]
    PCX Format - ModdingWiki
    Sep 18, 2024 · Version, PC Paintbrush version. Acts as file format version. 0 = v2.5 2 = v2.8 with palette 3 = v2.8 without palette 4 = Paintbrush for Windows
  10. [10]
    The PCX File Format: Very Old and Somewhat Gray - Theo
    The PCX format is an old, popular graphical file format, originally used by PC Paintbrush, and adapted for older slow computers.
  11. [11]
    PiCture eXchange (PCX) - The Library of Congress
    May 18, 2023 · The ZSoft PCX File Format Technical Reference Manual (FileFormat.com) defines the fixed length PCX File Header Format, including byte, version ...
  12. [12]
    DCX - Just Solve the File Format Problem
    Dec 28, 2023 · DCX is an image file format based on PCX, supporting multiple images, and may be used for fax images. It begins with a 4-byte signature.
  13. [13]
    PCX Header Format - Fastgraph
    PCX Header Format. PCX files begin with a 128-byte header: offset. size. description. 0. 1. manufacturer byte, must be 10 decimal. 1. 1. PCX version number. 0 = ...Missing: structure | Show results with:structure
  14. [14]
    PCX Specification - Martin Reddy
    ZSoft has recently added the capability to store palettes containing more than 16 colors in the .PCX image file. The 256 color palette is formatted and treated ...
  15. [15]
    Paint - BetaWiki
    ... Paintbrush ( PBRUSH.EXE ). This version introduced support for the BMP and PCX format. With the release of Windows NT 3.1, Paintbrush was also ported to Win32.
  16. [16]
    [PDF] GNU Image Manipulation Program User Manual
    Jul 15, 2007 · The HTML version is also available as context sensitive help (if you installed it) while using GIMP by pressing the F1 key. ... PCX, BMP ...<|separator|>
  17. [17]
    IrfanView Formats
    Supported file formats in IrfanView ; PCX, DCX*, PC Paintbrush format from ZSoft Corporation. X ; PDF*, Portable Document format. X ; PDN*, Paint.NET file format.IrfanView PlugIns · IrfanView 64-bit version · Faq · Languages
  18. [18]
    General Documentation - FFmpeg
    FFmpeg can use the AMD Advanced Media Framework library for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE).Missing: demuxer | Show results with:demuxer
  19. [19]
    Image Formats - ImageMagick
    ImageMagick is a powerful open-source software suite for creating, editing, converting, and manipulating images in over 200 formats.
  20. [20]
    Looking for Doom 2 pre-release screenshots - Doomworld
    Oct 22, 2012 · I came across a set of pre-release Doom 2 screenshots. If I remember correctly, they were distributed as a number of loose PCX files packed much in the same ...
  21. [21]
    Files - Duke3d Editart Related Tools - 2001-current/rtcm
    -Draw on Duke Nukem 3D graphics and create new .ART slots. -Edit all aspects of any sprite in 2D mode! -Export and import Duke Nukem 3D graphics as PCX files. - ...
  22. [22]
    New Old Keen History From Scott Miller - Apogee/3DR Founder
    Nov 14, 2022 · John Romero sent me all the original Commander Keen levels in PCX image format (on the two blue floppies) for marketing. They were also starting ...