PSD File Documentation
Summary
A PSD (Adobe Photoshop Document) file is the layered, editable working file that Adobe Photoshop saves, keeping every layer, mask, adjustment, text object and colour profile separate so the image stays fully editable. Adobe introduced it in 1990 with Photoshop 1.0; its MIME type is image/vnd.adobe.photoshop and files begin with the 8BPS signature. Open a .psd in Photoshop, GIMP, Krita or the free browser editor Photopea; flatten it to JPG or PNG to share.
Technical details
| Feature | Value |
|---|---|
| Full name | Adobe Photoshop Document |
| File extension | .psd |
| MIME type | image/vnd.adobe.photoshop |
| Format type | Layered raster image (proprietary binary) |
| Developer | Adobe (Adobe Inc.) |
| Introduced | 1990 (Adobe Photoshop 1.0) |
| Version field | 1 = PSD; 2 = PSB (large document) |
| Byte order | Big-endian |
| Magic number (hex) | 38 42 50 53 (“8BPS”) |
| Header length | 26 bytes (fixed) |
| Max dimensions | 30,000 × 30,000 px (PSD); 300,000 px (PSB) |
| Max file size | 2 GB (PSD); 4 EB (PSB) |
| Channels | 1–56 (typically up to 24, including alpha) |
| Bit depth | 1, 8, 16 or 32 bits per channel |
| Colour modes | Bitmap, Grayscale, Indexed, RGB, CMYK, Multichannel, Duotone, Lab |
| Compression | Raw or PackBits (RLE) per channel |
| Layers | Yes — raster, adjustment, text, shape, smart objects |
| Colour management | Embedded ICC profile in the image-resources block |
| Open standard | No — proprietary, but the spec is published by Adobe |
| Related extensions | .psb, .ai, .tif, .png, .jpg, .pdf, .eps |
| Specification | adobe.com/devnet-apps/photoshop/fileformatashtml/ |
What is a PSD file?
PSD stands for Photoshop Document, the native file format of Adobe Photoshop. Adobe shipped it with Photoshop 1.0 in 1990, and it has stayed the program’s working format ever since. Unlike a finished JPG or PNG, a PSD is not a single flat picture. It stores the whole project in an editable state: every layer, layer mask, adjustment layer, blending mode, editable text run, vector shape, smart object and colour profile is kept separate so any part can be changed later. That editability is why designers hand over PSDs as source files and why the format is central to photo retouching, web mock-ups and print work.
PSD is a proprietary binary format identified by the four-byte signature 8BPS. Adobe publishes the file-format specification, which is why GIMP, Krita, Affinity Photo and the browser editor Photopea can all read and write it with varying fidelity. A classic .psd caps out at 30,000 × 30,000 pixels and 2 GB; past that, Photoshop switches to the PSB large-document format, which shares the same 8BPS signature but sets the version field to 2. Everything below describes how the bytes are actually laid out.
The 26-byte file header: 8BPS, channels, dimensions, depth and mode
A PSD opens with a fixed 26-byte header. All multi-byte integers in the format are big-endian (most significant byte first), a convention inherited from the format’s Macintosh origins. The header packs the seven fields a reader needs before it can interpret anything else:
Offset Size Field Meaning
------ ---- ----------- -------------------------------------------
0 4 Signature always '8BPS' (38 42 50 53)
4 2 Version 1 = PSD, 2 = PSB
6 6 Reserved must be zero
12 2 Channels 1-56, incl. alpha (RGB image = 3, RGBA = 4)
14 4 Height image rows in pixels (1-30000, PSB 1-300000)
18 4 Width image columns in pixels
22 2 Depth bits per channel: 1, 8, 16 or 32
24 2 Colour mode 0=Bitmap 1=Gray 2=Indexed 3=RGB 4=CMYK ...
The channels count is the total number of colour and alpha channels, so an RGB image reports 3 (or 4 with transparency) and a CMYK image reports 4. Height and width are stored as unsigned 32-bit integers, which is why the classic limit is 30,000 in each dimension. Depth is the bits per channel: 8-bit is standard, 16-bit is used for high-dynamic-range retouching, and 32-bit float supports true HDR. The colour mode at offset 24 selects the interpretation of the pixel data, and it also determines whether the next section carries a palette.
| Mode value | Colour mode |
|---|---|
| 0 | Bitmap (1-bit) |
| 1 | Grayscale |
| 2 | Indexed colour (uses a palette) |
| 3 | RGB |
| 4 | CMYK |
| 7 | Multichannel |
| 8 | Duotone |
| 9 | Lab |
The four length-prefixed sections after the header
Following the header, a PSD is a strict sequence of four sections, each introduced by a length field so a reader can skip a section it does not need. The order is fixed:
[ 26-byte header ]
[ Colour Mode Data section ] 4-byte length + data
[ Image Resources section ] 4-byte length + resource blocks
[ Layer and Mask Info ] 4-byte length + layer records
[ Image Data section ] the flattened composite, to EOF
The Colour Mode Data section is empty for RGB and CMYK (length 0), but for Indexed mode it holds a 768-byte palette (256 RGB triplets) and for Duotone it holds the opaque duotone specification. The Image Resources section is a series of resource blocks, each tagged 8BIM, that store non-pixel metadata: the embedded thumbnail, guides and grid, print settings, the resolution, the EXIF block and the embedded ICC colour profile. The Layer and Mask Information section is where the real work lives, and the final Image Data section holds one flattened composite of the whole document.
The Layer and Mask Information section, record by record
This section is what makes a PSD a PSD rather than a flat image. It begins with its own total length, then a layer-info block that starts with a signed 16-bit layer count. A negative count is a deliberate flag: it tells the reader that the first alpha channel holds the merged transparency for the whole document. After the count comes one layer record per layer, in bottom-to-top order.
Each layer record carries the layer’s bounding rectangle (top, left, bottom, right as four 32-bit integers), the number of channels in that layer and a descriptor for each, the blend-mode signature 8BIM followed by a four-character blend key (norm, mul , scrn, over and so on), an opacity byte (0–255), a clipping flag, and layer flags including the visibility bit. A variable-length “extra data” field then holds the layer mask data, the layer blending ranges, the Pascal-style layer name, and a run of additional-information blocks (again tagged 8BIM) that encode adjustment-layer settings, layer effects, the Unicode layer name, section dividers for groups, and the type tool data for editable text.
After all the layer records come the channel image data for every layer, each channel prefixed by a two-byte compression code: 0 for raw bytes and 1 for PackBits run-length encoding. Because each layer’s pixels are stored independently, an editor can composite the document by drawing the layers in order, applying each blend mode and opacity in turn.
Editable text, vector shapes and smart objects
A PSD stores more than pixels. Editable text is kept as a type tool object (the TySh additional-info block), which holds the actual character string plus a serialised engine dictionary describing font, size, tracking, colour and paragraph settings, so the text can be re-edited rather than re-typed. Vector shapes and vector masks are stored as paths: a resource of Bezier knot records giving anchor points and control handles, resolution-independent so a shape layer stays crisp at any zoom.
A smart object embeds (or links to) the original source data of a placed file inside the PSD, together with a transform matrix. That is how a placed AI file, a RAW photo or another PSD can be scaled and filtered non-destructively: Photoshop keeps the original bytes and re-renders the smart object on demand. These constructs are the parts that lower-fidelity readers most often rasterise, because reproducing Photoshop’s type and effects engines exactly is hard.
The composite Image Data section and how other apps read it
The last section of the file is a single merged image: the whole document flattened to one raster, stored in planar order (all of channel 1, then all of channel 2, and so on) with the same two-byte compression code that the layer channels use. This composite exists so that a program which does not understand Photoshop’s layer model can still display the file. Image viewers, thumbnailers and PDF placement all read this composite rather than reconstructing the layers.
It is also why a PSD saved with the “Maximize Compatibility” option is larger: that option forces Photoshop to write the full flattened composite in addition to the per-layer data, roughly doubling the pixel storage. Turning it off saves space but can leave the file unreadable to apps that only parse the composite. The same duplication of a full preview alongside uncompressed-ish layer data is the main reason PSDs balloon to hundreds of megabytes.
PSD, PSB and layered TIFF: the same layer model in three wrappers
PSD, PSB and layered TIFF all encode Photoshop’s layer structure, and Photoshop can round-trip layers through any of them. PSB is byte-for-byte almost identical to PSD but promotes the 32-bit length and dimension fields to 64-bit where needed, lifting the limit to 300,000 pixels per side and file sizes into the exabyte range; its header version field is 2 instead of 1. A layered TIFF stores the same layer-and-mask block inside a TIFF ImageSourceData tag, so a TIFF can carry Photoshop layers while remaining a standard TIFF that ordinary readers open as a flat image.
For delivery, the flattened composite is exported to a portable format. Export to PNG keeps a lossless image with alpha; export to JPG gives a small lossy photo with no transparency; export to PDF wraps the composite (optionally keeping editability through Photoshop PDF). Converting a PSD to SVG is not a real conversion, because PSD pixels are not vector paths; it requires tracing the raster into shapes.
References
- Adobe — Photoshop File Format Specification
- Adobe — About PSD and PSB file formats and large documents
- Encyclopedia of Graphics File Formats — Adobe Photoshop (PSD) summary
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.