A valid 1x1 pixel RGB PSD file (base64-encoded):

| Type ID | Name | Description | |---------|------|-------------| | 0 | Raw | Uncompressed (rarely used except for very small images) | | 1 | RLE (Run-Length Encoded) | PackBits compression – efficient for images with large uniform areas. Each scanline is compressed independently. | | 2 | ZIP (without prediction) | Deflate compression (zlib) – slower but higher ratio. | | 3 | ZIP (with prediction) | Applies a delta filter before ZIP – best for continuous-tone images. |

As a result, no open-source implementation fully supports writing all PSD features without data loss. GIMP, for example, will flatten certain adjustment layers on import. Because PSD can embed JavaScript (via scripts or events) and arbitrary binary data in resource blocks, malformed PSD files have been used in exploits (e.g., CVE-2016-0965). Forensic analysts often parse the "Image Resources" section for hidden data or steganographic payloads. 8. Comparison with Other Layered Formats | Format | Layer Support | Compression | Open Standard | Max Dimensions | |--------|---------------|-------------|---------------|----------------| | PSD | Full (masks, styles, adjustments) | RLE, ZIP | No (but documented) | 30,000 px (PSB: 300k) | | TIFF | Basic (multi-page as layers) | LZW, ZIP, JPEG | Yes | 4 GB (BigTIFF: 18 EB) | | OpenEXR | Multi-part (layers as channels) | PIZ, B44, DWAA | Yes (ILM) | Unlimited (64-bit) | | Krita .kra | Full (vector, filters) | ZIP (internal) | Yes (XML+zip) | 100k px |

| Problem | Description | |---------|-------------| | | Many layer effects (drop shadow, bevel, pattern overlay) rely on private keys that third-party apps reverse-engineer incompletely. | | Adjustment layer data | Curves, Levels, Selective Color use complex serialized structures that differ across Photoshop versions. | | Smart Objects | Embedded document data (sometimes another full PSD) – correctly updating them requires recursive parsing. | | Text layers | Store both a rasterized preview and a TySh block containing Adobe’s own text engine state (fonts, kerning, OpenType features). | | Layer comps | Snapshots of layer visibility/position – optional but often critical for design workflows. |

The Photoshop File Format (PSD): Architecture, Layered Compression, and Interoperability Challenges