This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Mathematica Import/Export Format

PCX (.pcx)

Common MIME types: application/pcx, image/pcx
Paintbrush PCX format.
Raster image format.
Legacy format used on Microsoft DOS.
Binary format.
Compresses image data using run-length encoding after restriction to a color map.
Can also store true color raster images.
Developed by ZSoft as part of the PC Paintbrush application.
  • Import and Export fully support Version 5 of the PCX format.
  • Import["file.pcx"] imports a PCX file, returning a graphics object.
  • Export["file.pcx", expr] exports graphics or any other expression as an image to a PCX file.
  • Import["file.pcx"] returns an expression of the form Graphics[Raster[data], opts], where data is an array of RGB color values.
  • Export["file.pcx", expr] creates a PCX image with the same image size as the displayed form of expr.
  • Because PCX is a raster image format, all fonts are rasterized on export.
  • Import["file.pcx", elem] imports the specified element from a PCX file.
  • Import["file.pcx", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.pcx", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "PCX"] or Import["file", {"PCX", elem, ...}].
  • Export["file.pcx", expr, elem] creates a PCX file by treating expr as specifying element elem.
  • Export["file.pcx", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each expri as specifying the corresponding elemi.
  • Export["file.pcx", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.pcx", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Data"array of color values
"Graphics"Graphics object representing an image
"GrayLevels"array of normalized gray-level values
"RGBColorArray"array of RGBColor objects
  • Import and Export by default use the "Graphics" element for PCX files.
"BitDepth"bits used to represent each color channel in the file
"ColorSpace"color encoding used in the file
"ImageSize"raster dimensions
  • General option:
ImageSizeAutomaticoverall image size