{"id":"image-x-pcx","mimeType":"image/x-pcx","name":"PiCture eXchange","shortName":"PCX","category":"Legacy \u0026 Raster Graphics","extensions":[".pcx"],"description":"The image/x-pcx MIME type represents the PiCture eXchange (PCX) image format. Developed by ZSoft Corporation in the mid-1980s for their PC Paintbrush software, PCX became one of the first widely accepted DOS-era graphics standards. It utilizes a very simple byte-oriented Run-Length Encoding (RLE) compression scheme, which required minimal CPU power to decode. This made it extraordinarily popular for 1990s MS-DOS video games (like DOOM, Duke Nukem 3D, and Quake) for storing textures and UI assets. While eventually superseded by more efficient formats like GIF, JPEG, and PNG, PCX remains historically significant in early PC graphics and retro game development.","seo":{"title":"image/x-pcx MIME Type | Developer Reference for PCX Format","description":"Complete reference for the image/x-pcx MIME type: PiCture eXchange (PCX) format, ZSoft Paintbrush, MS-DOS history, RLE compression, and magic bytes.","faqs":[{"question":"What is a PCX file?","answer":"A PCX file is a legacy raster image format created by ZSoft for its PC Paintbrush program. It was one of the most common image formats on DOS and early Windows systems before JPEG and PNG became standard."},{"question":"Why did so many classic PC games use PCX files?","answer":"PCX files use a very simple Run-Length Encoding (RLE) compression method. In the early 1990s, when CPU cycles and memory were heavily constrained, game engines (like the Doom engine) could decompress and load PCX images incredibly fast compared to more complex formats."},{"question":"How do I open a PCX file today?","answer":"Modern web browsers do not support PCX. To view or edit them, you must use image editing software like Adobe Photoshop, GIMP, or classic image viewers like IrfanView and XnView."}]},"index":{"compression":["Run-Length Encoding (RLE)"],"browserSupport":{"score":1,"label":"None"},"commonUses":["MS-DOS and Early Windows Graphics","1990s Video Game Assets (Textures, UI)","Retro Computing Archival"]},"technical":{"magicBytes":{"hex":"0A (followed by version, e.g., 0A 05 01 08)","ascii":"\\x0A"},"container":"ZSoft Proprietary Header (128 bytes)","compressionAlgorithm":["ZSoft RLE"],"colorDepth":["1-bit (Monochrome)","4-bit (16 colors)","8-bit (256 colors)","24-bit (True Color)"],"transparency":false,"animation":false,"metadata":{"exif":false,"xmp":false,"iccProfile":false},"alphaChannel":false,"progressiveLoading":false,"hdrSupport":false},"history":{"developer":"ZSoft Corporation","released":"1985","specification":"ZSoft PCX File Format Technical Reference Manual"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"Adobe Photoshop","logo":""},{"name":"GIMP","logo":"gimp.svg"},{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"IrfanView / XnView","logo":""}],"conversion":{"convertTo":["png","jpeg","bmp","gif"],"convertFrom":["bmp","png"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/x-pcx"},{"header":"Content-Type","value":"image/pcx"}],"htmlAccept":"image/x-pcx, .pcx","fileDetection":["PCX files have a fixed 128-byte header.","Check the first byte (Offset 0). It must always be 0x0A (10), representing ZSoft as the manufacturer.","The second byte (Offset 1) indicates the version (0, 2, 3, 4, or 5).","The third byte (Offset 2) is the encoding method, which is almost universally 0x01 for RLE.","The fourth byte (Offset 3) represents the bits per pixel per plane (1, 2, 4, or 8)."]},"prosCons":{"pros":["Incredibly simple RLE algorithm makes it very fast to decode, which was historically vital for early 3D video game engines","Retains crisp, lossless pixel data suitable for pixel art and interface assets","Well-documented and highly supported by older desktop publishing and image editing software"],"cons":["Extremely inefficient compression by modern standards, producing large file sizes compared to PNG","Lacks modern imaging features such as alpha channel transparency, EXIF metadata, and color profiles","Zero support in web browsers; must be converted to PNG for web use"]},"specifications":{"url":"http://www.fileformat.info/format/pcx/egff.htm","rfc":"","mimeAliases":["image/pcx","application/pcx","application/x-pcx"]},"developerSnippets":{"python":"import magic\n# Libmagic can easily detect the ZSoft PCX header\nprint(magic.from_file('graphic.pcx', mime=True)) # Outputs 'image/x-pcx' or 'image/pcx'","nodejs":"const fs = require('fs');\n// Manually detecting the ZSoft PCX magic header\nconst buffer = Buffer.alloc(4);\nconst fd = fs.openSync('graphic.pcx', 'r');\nfs.readSync(fd, buffer, 0, 4, 0);\nfs.closeSync(fd);\n// Check Manufacturer (0x0A), valid version (0-5), and encoding (0x01)\nconst isPCX = buffer[0] === 0x0A \u0026\u0026 buffer[1] \u003c= 5 \u0026\u0026 buffer[2] === 0x01;\nconsole.log('Is ZSoft PCX:', isPCX);","go":"import (\n    \"bytes\"\n    \"net/http\"\n)\n// Native Go HTTP detection does not recognize PCX.\n// You must explicitly check the first few bytes:\n// isPCX := len(buf) \u003e= 4 \u0026\u0026 buf[0] == 0x0A \u0026\u0026 buf[1] \u003c= 0x05 \u0026\u0026 buf[2] == 0x01","php":"$mime = mime_content_type('graphic.pcx');\necho $mime; // Standard PHP setups will return 'image/x-pcx' or 'image/pcx' depending on the system magic database"},"relatedFormats":["bmp","png","tga"]}
