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

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.

If you already saved and closed the file

This is the case most people are in when they search how to unflatten an image, and the usual answer is short. On Adobe's forum the thread How can I unflatten layers in my Photoshop file? has been viewed more than 67,000 times, and its accepted answer is that once History is gone, there is no way to unflatten the file. That is true of the file itself. Before rebuilding, check the places a layered copy may still exist:

  • Your sent mail and shared links: a layered PSD you sent to a client, printer or teammate.
  • Version history in the cloud: Photoshop cloud documents, Dropbox, Google Drive and OneDrive keep earlier versions of a file.
  • Backups of your computer: Time Machine on a Mac, File History on Windows.
  • Your app's backup folder: Clip Studio Paint and some other painting apps keep automatic backups of open files.
  • An export with layers: a PDF or TIFF saved with layers, or the PSD that came with a template you bought.

If none of those has it, the layers have to be rebuilt.

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.

Check the result before you build on it. Look at the edges of each element at 100%, compare the repainted background with the original wherever something used to cover it, and rename anything the model named too generically. Keep the flat original in the same folder: if a client later finds the source document, its live text and effects win, and the rebuilt version becomes a record of what changed.

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

What a rebuild gives you, and what is gone for good

Each visible element on its own layer
Yes, rebuilt from the pixels
Positions and size
Yes, every layer where it was, at the original size
Background behind each element
Painted in, so nothing leaves a hole
Layer names
New names from what each layer shows
Live text and fonts
Lost: text comes back as an image of the text
Smart objects, masks, adjustment layers, effects
Lost
Anything that was completely hidden
Lost: it is not in the image, so it is painted in, not recovered

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

What does flattening an image mean?

Flattening merges all the layers of an image into one layer. What is visible is kept as a single picture; hidden layers and everything one layer covered on another are discarded. Saving as JPG or PNG flattens too, because those formats cannot store layers.

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.

Can I unflatten a flattened PDF?

Flattening a PDF merges form fields, annotations and layers into the page content, and it cannot be undone in the saved file either. Go back to the unflattened PDF if one exists. This guide is about image layers; to split the image on a PDF page into layers, export the page as a PNG first.

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.