Skip to content
PhotoPSD
PSDFile formats 3 min read

What is actually inside a PSD file

A PSD is not a picture with layers glued on. It is a container with a header, colour blocks, layer records and a separate flattened composite — which explains most of its odd behaviour.

On this page
  1. The four sections, in order
  2. Why the composite matters more than you think
  3. RLE, ZIP and why files get huge
  4. What “supports PSD” usually means
  5. Try it against a real file

Open a .psd in a hex editor and the first four bytes read 8BPS. That is the whole of the visible magic: everything after it is a sequence of sections, and almost every surprising thing about PSD files comes from how those sections relate to each other.

The four sections, in order

A PSD is laid out as a file header, a colour mode data block, an image resources block, and then layer and mask information followed by the flattened image data.

The header is small: version (PSD or the large-document PSB variant), channel count, height, width, bit depth and colour mode. Everything else in the file depends on those six numbers.

The colour mode block holds the palette for indexed files and nothing at all for RGB, which is why an RGB PSD and an indexed one behave so differently in old software.

The image resources block is where the metadata lives: the ICC profile, the resolution, guide grids, slice definitions, the thumbnail Photoshop embeds for the open dialog, even the version string of the application that wrote the file. This section is meant to be skippable, and readers that ignore it still open the file.

Then come the layers. This is the part people actually care about, and it is the most complicated: a list of layer records carrying names, opacity, blend mode, masks, blending ranges, and a set of additional tagged blocks that hold text engine data, vector paths, layer effects and smart object references.

Why the composite matters more than you think

At the very end of the file, after the layer data, PSD stores a flattened composite of the whole document.

That composite is why a PSD can look right while being structurally broken. Image viewers that do not understand layers simply show the composite — always correct, always flat. Open the same file in an editor that reads the layer stack and you may find a missing font, an unreadable smart object or a layer group that fails to reconstruct, and the result looks different from the preview you saw five minutes earlier.

When someone says “the file opens but something is missing”, they are almost always describing exactly this gap: composite loaded, layer stack partially rebuilt.

RLE, ZIP and why files get huge

Layer channel data can be stored raw, RLE-compressed or ZIP-compressed, and Photoshop picks per channel. Photographic layers tend to use ZIP, flat colour areas compress well with RLE, and 16-bit data is often stored uncompressed because the compression gains do not pay for the time.

The practical consequence is that PSD file size is a poor proxy for image size. A 4000 × 4000 document with thirty adjustment layers can weigh less than a 4000 × 4000 single-layer photo, because adjustment layers carry parameters rather than pixels.

What “supports PSD” usually means

Editors claim PSD support at very different levels, and it is worth knowing which one you are getting:

  • Composite only — the file opens as a flat image. Fine for viewing, useless for editing.
  • Layers, basic — layer names, visibility, opacity and blend modes are read, but effects, smart objects and text are rasterised or dropped.
  • Layers, full — text stays editable where the font exists, masks and adjustment layers keep their parameters, and the file can be written back without flattening.

The last one is what a working file needs. It is also where most of the engineering effort in a PSD reader goes, which is why browser editors took years to get there.

Try it against a real file

If you want to see the structure rather than read about it, open a layered PSD in the PhotoPSD editor: the Layers panel mirrors the layer records, the Channels panel shows the stored channels, and the Properties panel shows document metadata that came out of the image resources block. Converting the result to a flat deliverable is a separate step — PSD to PNG walks through it.

Skip the download and try it now

Open a layered PSD, edit it, export a PNG — nothing is uploaded.

Open the editor

Related reading