Tech

Layers, Masks and Smart Objects: How a PSD File Works

You open a PSD and the panel on the right is stacked with dozens of layers and cryptic icons. What's a mask, how does a smart object differ from an ordinary layer, and why doesn't an adjustment layer ruin the photo? Let's look under the hood of the Photoshop format and take apart, piece by piece, what a PSD file is really made of — no formulas, just plain English.

A retoucher with a stylus and graphics tablet editing a black-and-white photo on a laptop
Behind every edited photograph is a layered PSD — a stack of elements the designer controls. Photo: Pexels

Layers — the foundation of everything

Strip away everything else, and a PSD is a stack of layers. Picture a set of transparent sheets laid one on top of another: the background on the bottom, an object above it, text higher up, a logo on top. Look down through them and you see one whole picture, yet every "sheet" stays separate.

This simple idea is the source of Photoshop's entire power. Any layer can be moved, hidden, made semi-transparent, swapped with its neighbour or deleted — and the rest are unharmed. The PSD format exists precisely for this freedom: it carefully stores every layer on its own.

The key idea

The final picture in a PSD isn't a "painted" image — it's the result of stacking layers top to bottom. Change a layer's order or opacity and the picture instantly changes, with no repainting.

The kinds of layers

Layers in a PSD come in several types — each with its own role:

  • Raster layer — ordinary pixels: a photo, a fill, a texture, a brush stroke.
  • Text layer — a caption that stays "live": you can rewrite the text and change the font and size at any time.
  • Adjustment layer — a brightness, contrast, curves or color setting that affects everything below it without touching the pixels themselves.
  • Shape layer — a vector form (rectangle, circle, custom path) that scales with no loss of sharpness.
  • Group — a folder that holds related layers, to keep things tidy and manage them together.
A laptop running Photoshop with a storyboard of several captioned shots on the canvas
One document easily holds dozens of layers of different types — raster, text, adjustment. Photo: Pexels

Masks: hide, don't erase

The mask is probably the most underrated tool. To remove something unwanted, a beginner grabs the eraser and wipes out pixels. The trouble is, what's erased is gone for good: change your mind and you'll have to roll back the history or start over.

A mask solves this elegantly. It doesn't delete pixels, it merely hides them. Technically it's a black-and-white image on top of the layer: black hides, white reveals, grey makes things semi-transparent. Want the hidden parts back? Paint the mask white and everything returns. That's "non-destructive editing" — edits you can always undo.

A mask isn't an eraser, it's a visibility switch. It destroys nothing: whatever is hidden can always be brought back.

Smart objects: containers with memory

An ordinary raster layer "forgets" the original: shrink an image, then enlarge it, and it goes blurry, because the discarded pixels can't be recovered. A smart object works differently. It's a container layer that stores the source in full inside.

What that gives you in practice:

  • Lossless scaling. Shrink and enlarge as much as you like — sharpness holds, because Photoshop always pulls quality from the hidden original.
  • Linked copies. Make several copies of a smart object, edit the contents of one, and they all update. Indispensable for templates and mockups.
  • Safe filters. Effects on a smart object are applied "on top" and can be switched off at any time without harming the source.

Channels and transparency

Under the hood, color in a PSD is split into channels. In RGB mode there are three — red, green, blue; each stores how brightly its color shines in every pixel. Add the three together and you get a full-color picture. In CMYK mode there are four channels (for print), and in Grayscale just one.

Separately there's the alpha channel — it handles transparency. It's thanks to the alpha channel that a PSD (and later a PNG) can store a transparent background: the alpha channel says which pixels are visible and which are "see-through."

What's really inside the file

A designer at a large monitor with a grid of many shots, a board of photos behind them
All this structure — layers, masks, channels — is packed into the single file the designer sees. Photo: Pexels

Described as a file, a PSD's structure is logical and predictable:

  1. Header. The basics: canvas dimensions, color mode, bit depth, channel count.
  2. Color and resource data. Color profiles, guides, metadata.
  3. Layer and mask section. The heart of the file: all the layers, their pixels, masks, effects and stacking order.
  4. Flattened image. At the very end, a "flat" picture of the whole document. Programs use it to show a quick preview without parsing the entire file layer by layer.
Compression
Lossless (RLE)
RGB channels
3 + alpha
Bit depth
8 / 16 / 32-bit
Modes
RGB / CMYK / Grayscale / Lab
PSD limit
30,000 px, 2 GB
PSB limit
300,000 px

It's precisely because of the layer section and the flattened preview that a PSD weighs so much. There's more on sizes and the format's history in our article on what PSD is.

Why a regular person should know this

You might think a PSD's internals are a designer's concern only. But understanding the structure saves headaches for anyone who has ever held such a file:

  • You'll understand why a PSD won't open in a browser. A browser can't assemble a picture from layers — it needs a finished PNG or JPG.
  • You won't lose your edits. Knowing that all the editability lives only in the source, you'll keep the PSD, not just the flattened picture.
  • You won't wreck the quality. You'll see why converting to JPG flattens layers and why that's a one-way street.

Need a finished picture from a PSD?

The free FormatZ converter carefully flattens all the layers, masks and effects into a clean PNG — right in your browser, with no Photoshop and no install.

Convert PSD to PNG

Want to first understand how PSD differs from finished formats? See PSD vs PNG and JPG. And if you don't have Photoshop handy, learn how to open a PSD without it. The full list of conversions is on the all formats page.

The eraser deletes pixels for good — you can only undo within the history. A mask deletes nothing: it simply hides areas of a layer, making them transparent. At any time you can bring the hidden parts back by painting the mask white. That is non-destructive editing.
A smart object is a container layer that stores the original image or vector inside. You can scale it down and up as much as you like with no loss of sharpness, because Photoshop always refers to the source. And editing its contents updates every copy of the object in the layout at once.
An adjustment layer changes the brightness, contrast or color of everything beneath it without touching their pixels. It is convenient: you can dial the setting down, up, or delete it at any time without ruining anything. Ordinary per-pixel correction can't do that.
No. Exporting to PNG or JPG flattens all layers into a single flat picture. The structure — layers, masks, smart objects — stays only in the original PSD. That is why you should keep the original separately for future edits.
The header records the document basics: canvas width and height, color mode (RGB, CMYK, Grayscale), bit depth (8/16/32-bit) and channel count. After that come the layer and mask data, and at the end a flattened image used for the preview.