| 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

The Adobe Photoshop File Format (PSD) is the de facto standard for digital image editing and graphic design. Unlike raster-only formats such as JPEG or PNG, PSD is a hybrid container that supports a rich model of layers, masks, blending modes, vector shapes, and non-destructive adjustments. This paper examines the internal architecture of the PSD format, including its file header, color mode data, image resources, and the crucial layer and mask information blocks. It analyzes how the format achieves backward compatibility and handles compression (RLE, ZIP). Finally, it discusses the interoperability limitations of PSD in open-source software and the emergence of the extended PSB format for large documents. 1. Introduction Since its introduction in 1990, Adobe Photoshop has dominated the raster graphics editing market. A key reason for its longevity is the proprietary PSD (Photoshop Document) format, which preserves an editor’s entire working state. While standard image formats flatten all edits into a single bitmap, PSD retains individual layers, text editability, adjustment layers, and layer styles. Understanding PSD is important not only for digital artists but also for software engineers developing compatible applications (e.g., GIMP, Krita, Affinity Photo) and archival systems.

| 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 |

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