File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Images
  • Raster
  • Vector
  • Camera raw
  • Layered projects
  • HDR & scientific
  • Icons
  • Retro
  1. Home
  2. Images
  3. Retro
  4. PCX
.PCX
  • Overview

.PCX

PC Paintbrush image

Introduction

PCX is the format of PC Paintbrush, a paint program from ZSoft first released in 1985. It became one of the most common image formats on MS-DOS, used by scanners, fax software and many games, and grew through several versions from monochrome and 16-colour EGA images to 256-colour VGA and 24-bit colour.

Its compression is a simple run-length encoding, so it suits flat-coloured artwork far better than photographs.

Software

  • GIMP (Windows, macOS, Linux)
  • IrfanView (Windows)
  • XnView MP (Windows, macOS, Linux)
  • ImageMagick (Windows, macOS, Linux)
  • GrafX2 (Windows, macOS, Linux)
  • Netpbm pcxtoppm (Windows, macOS, Linux)

Structure

A PCX file starts with a 128-byte header. Its first byte is always 0A, followed by the version, the encoding (1 for run-length encoding) and the bits per pixel in each plane. The image bounds come next as four little-endian numbers, so the width is xmax − xmin + 1. A 16-colour palette sits inside the header, and later fields give the number of colour planes and the bytes per line of each plane.

The image data follows as run-length encoded lines. A byte with its top two bits set (C0 or above) is a count in its low six bits, and the next byte is repeated that many times; any other byte is a single pixel value. A 256-colour image ends with the byte 0C and a 768-byte palette of 256 RGB colours.

  1. 0Header marker, version, bounds, resolution, 16-colour palette, planes128 bytes
  2. 128Image data run-length encoded lines, one plane after anothervaries
  3. …256-colour palette 0C and 768 bytes, version 5 only769 bytes
A PCX file: header, image data and palette
© 2026 fileformats.org About Contact Made by Lewpen