LayerGrab

How to Unflatten an Image

Unflattening is the process of getting back the separate layers of an image after they were merged into one. You cannot unflatten an image with a command: flattening merges every layer into one grid of pixels and discards what was hidden behind them. You can get the real layers back only from undo or history while the file is still open, or from an earlier saved version. If none exists, you can rebuild new layers with an AI layer separator.

Last updated 2026-09-29

Why flattening cannot be reversed

A layered file stores every layer separately, including the pixels one layer hides behind another. Flattening keeps only what is visible and writes it into a single layer. The hidden pixels are not stored anywhere after that, so no command can split the result back into the original layers.

That is why every real way back goes to a copy made before the flatten: the undo history, the last save, or a backup.

Four ways back, in the order to try them

  1. 1

    Undo, if the file is still open

    Press Ctrl+Z (Cmd+Z on Mac) or step back in the History panel in Photoshop. Undo history is lost once the document is closed.

  2. 2

    Revert to the last save

    If you flattened after your last save, File > Revert in Photoshop reloads the saved file, layers included.

  3. 3

    Look for an earlier version

    Cloud documents and synced folders keep version history: Photoshop cloud documents, Figma files, Dropbox, Google Drive, OneDrive and Time Machine can all restore a copy from before the flatten.

  4. 4

    Rebuild the layers with AI

    With only the flat image left, rebuild it as new layers: each element on its own transparent layer, with the background filled in behind them.

Rebuilding layers from the flat image

When no layered copy is left, an image layer separator is the fastest way back to an editable file. LayerGrab finds each element, puts it on its own transparent layer in its original position, and paints in the background behind it, so moving or deleting an element never leaves a hole.

Export the result as a layered PSD to keep working in Photoshop, or separate only the element you need to change.

Coffee shop poster — original
Original
Coffee shop poster — rebuilt: headline and badge on their own layers
Rebuilt: headline and badge on their own layers

When rebuilding is the wrong choice

If a teammate, client or printer might still have the layered file, ask them first: the original keeps live text, fonts and effects that rebuilt layers never have. Rebuilding also does not bring back content that was fully hidden before the flatten, because it is not in the image at all.

Frequently asked questions

Is there an unflatten command in Photoshop?

No. Layer > Flatten Image merges all visible layers into a single background layer and discards hidden ones. The only built-in ways back are Undo, the History panel and File > Revert, and they only work before the document is closed or saved over.

I saved and closed the flattened file. Are the layers gone?

From that file, yes: the layer data is no longer stored in it. Check for an earlier copy: a version in cloud or backup history, an exported PSD sent to someone, or an autosave. If there is none, the layers have to be rebuilt.

How do I unflatten a JPG or PNG?

A JPG or PNG never had layers in the first place, so there is nothing to restore. To edit its parts separately, split it with an AI tool that works out the elements and repaints the background behind them.

Will rebuilt layers match my original layers?

Not exactly. They are a new separation made from the pixels: text becomes a picture of the text rather than live type, and fonts, masks, adjustment layers and effects are not recovered. The elements and their positions match what you see in the image.

What does Flatten do in Figma?

In Figma, Flatten (Ctrl/Cmd+E) merges selected vector shapes into one vector path, which is a different operation from flattening a raster image. You can undo it, or restore an earlier state from the file's version history.