How to Unflatten an Image
in Photoshop
The honest guide — undo, History panel, Smart Object extraction, AI-assisted layer reconstruction, and the hard truth about what's actually recoverable after saving.
To unflatten an image in Photoshop, press Ctrl + Z (Cmd + Z on Mac) right after flattening, or open Window → History and click the state just above "Flatten Image". Both only work while the document is still open in the same session. If your layers were put into a Smart Object instead, double-click it to get them back. If the file was saved and closed flat, the original layers are gone, and your only option is rebuilding new layers from the flat pixels.
- Still open, just flattened —
Ctrl/⌘ + Z - Still open, edited since —
Window → History→ click the state above Flatten Image - Layer thumbnail has a small page icon — it's a Smart Object; double-click to open it
- Saved and closed flat — rebuild with
Select → SubjectandCtrl/⌘ + J - Got your layers back? Save as a PSD straight away
The Honest Answer
"How do I unflatten my image in Photoshop?" is actually four different questions. What decides it is whether the file has been saved and closed since it was flattened.
If the document is still open in the same session, your layers are usually recoverable in seconds. If you saved, closed and reopened a flat file, the original layer data is gone, and no plugin or AI tool can bring it back. What you can do is rebuild new layers from the flat pixels, which is useful but not the same thing.
This guide covers all four scenarios, starting with the quickest fixes.
If you saved a JPEG, PNG or flat PSD and closed it, the layers were merged when the file was saved, so they can't be separated again. Anything that claims to "unflatten" it is really rebuilding layers from the flat image, which is Method 4 below.
Which Situation Are You In?
| Situation | Can you get the layers back? | Use |
|---|---|---|
| Just flattened, file still open | Yes | Method 1: Undo |
| Edited since flattening, file still open | Yes, if the Flatten Image step is still in the history | Method 2: History panel |
| Layers were merged into a Smart Object | Yes | Method 3: Smart Object |
| Saved and closed as JPEG, PNG or flat PSD | No. You can only rebuild new layers. | Method 4: Rebuild |
Undo: The Fastest Fix
If flattening was one of the last things you did in this session, undo gets your layers back exactly as they were.
The Layers panel repopulates with every layer. If you've done other things since, keep pressing it, or use Edit → Step Backward (Ctrl + Alt + Z on Windows, ⌘ + Option + Z on Mac).
Make sure all your layers are back before you do anything else.
Go to File → Save As → Photoshop (.PSD). This keeps your layers safe if Photoshop closes.
Photoshop keeps 50 history states by default. If you've made more than that since flattening, the flatten step may have been pushed out. You can raise the limit in Edit → Preferences → Performance (on a Mac, Photoshop → Settings → Performance) so it doesn't happen next time.
History Panel: Jump Back to Any State
This method is recommended when you've made more changes since flattening and Undo won't get you back far enough. The History panel lets you jump to any recorded state in the current session.
Go to Window → History. It lists every action in this session, oldest at the top.
Scroll until you see the entry labelled Flatten Image. That's the moment your layers were merged.
Your layers reappear exactly as they were. Anything you did after flattening is removed when you go back, so think about whether that work matters.
Go to File → Save As → Photoshop (.PSD) straight away.
If you want to compare the layered and flattened versions without losing either, open the History panel menu, choose History Options and turn on Allow Non-Linear History. Going back to an earlier state then no longer deletes the later ones.
Remember that history only exists while the document stays open. Once you close it, the history is gone.
Extract Layers from a Smart Object
A Smart Object is different from a flatten image. When you convert layers into a Smart Object, Photoshop embeds the original layers inside it, so you can still open it and get them back. You can spot one by the small page icon in the corner of the layer thumbnail. Adobe's guide to embedded Smart Objects explains how they work.
In the Layers panel, double-click the thumbnail, not the layer name. Its contents open in a separate document, usually with a .psb extension.
Click the top layer, then Shift-click the bottom one.
Open the Layers panel menu and choose Duplicate Layers…. In the dialog, set the destination to your original document and click OK.
Switch back to your original document and confirm the layers are there. Close the Smart Object window without saving, delete the Smart Object layer, and save as a PSD.
If you want to group layers without losing them, use Convert to Smart Object (right-click the layers) instead of flattening.
Rebuild Layers from a Saved Flat File
If the file was saved and closed as a JPEG, PNG or flat PSD, you can't get the original layers back. What you can do is build new, separate layers from the flat pixels. How well it works depends on the image and how cleanly you need the pieces separated. If you're after a generic graphic like an icon or a background, it may be quicker to find a fresh layered file than to rebuild one.
The image opens as a locked Background layer. Double-click it to unlock it, then press Ctrl/⌘ + J to duplicate it as a backup.
Go to Select → Subject and Photoshop selects the main subject for you. In newer versions you can also use Remove Background from the Contextual Task Bar or the Properties panel.
With the selection active, go to Select → Select and Mask. Use the Refine Edge Brush on hair or other fine edges, and set the output to New Layer with Layer Mask so you can adjust it later.
With a selection active, press Ctrl/⌘ + J to copy it to a new layer. Give it a clear name, then repeat for each element you need to separate.
Ctrl/⌘-click the new layer's thumbnail to load its selection, grow it a few pixels with Select → Modify → Expand, then on the original layer go to Edit → Fill → Content-Aware. For tricky backgrounds, the Content-Aware Fill workspace gives you more control.
The result is a new set of layers made from pixels, not your original layers. Text becomes an image rather than editable text, layer effects are baked in, and gradients become pixel approximations. For client work, say clearly that you're rebuilding, and check whether that's good enough or whether you need the layered file from them.
Photoshop AI Tools That Help Most
Recent versions of Photoshop include several AI-assisted features that make rebuilding layers from a flat image faster and more accurate. These don't restore original layer data, but they cut down the manual work of building new layers from a JPEG or PNG.
Remove Background
One-click AI subject isolation. Cuts a layer to the subject with a transparent background in seconds. Best on subjects with clear contrast from background.
Photoshop 2024+Generative Fill
AI-powered fill using Adobe Firefly. Leave the prompt empty for natural background reconstruction after removing a subject — often more convincing than Content-Aware Fill on complex scenes.
Requires Creative CloudSelect Subject
AI-powered one-click selection of the main subject. Works on people, animals, products, and objects. Combine with Select and Mask for clean edges on complex scenes.
All recent CC versionsMatch Font
Identifies fonts in a flattened image (Type → Match Font). Draw a selection around the text, and Photoshop returns matching fonts from your system and Adobe Fonts.
Photoshop CC 2019+Select and Mask
Workspace for refining complex selections — hair, fur, fine detail. The Refine Edge Brush detects and separates fine edge detail that manual selection tools miss entirely.
All recent CC versionsNeural Filters
For colour matching, Smart Portrait adjustments, or style transfer on reconstructed layers. Useful for matching skin tones when recompositing portrait elements.
Requires Creative CloudIdentifying Fonts in a Flat Image
Text is the hardest thing to rebuild from a flat image, because it's just pixels. Match Font can identify the typeface so you can retype it as a live text layer.
Use the Rectangular Marquee Tool (M) to draw a tight selection around one line of text. Clear, high-resolution text gives the best results.
Go to Type → Match Font. Photoshop suggests similar fonts from your system and Adobe Fonts. Pick the closest one.
Use the Type Tool (T) to type it again. Match size, tracking and leading in Window → Type → Character, and sample the colour with the Eyedropper (I).
If Match Font can't find it, an online font identifier that accepts a screenshot is a reasonable next step.
How to Prevent This Next Time
Every scenario above is avoidable with a few saving habits. Always keep a layered PSD as your master file, and treat flat exports as copies.
| Habit | Why it works |
|---|---|
| Save a layered PSD before flattening | You always have the original to go back to. |
| Export JPEG or PNG with File → Export → Export As | It makes a flat copy without touching your layered document. |
| Convert to Smart Object instead of flattening | The layers stay embedded and can be extracted later. |
| Raise History States | A deeper undo buffer gives you more room within a session. |
| Don't overwrite your PSD with a flat version | Saving over it replaces the layers permanently. |
Keep your layered PSD and export flat copies from it. File → Export → Export As (Shift + Ctrl/⌘ + Alt + W) makes a flat file without changing the source document.
FAQ
Does Photoshop have an unflatten command?
No. There's a Flatten Image command but no reverse. The only built-in ways back are Undo and the History panel, and both only work while the document is still open in the same session.
Can a plugin or other software unflatten a saved JPEG?
No. Once layers are merged and the file is saved flat, the layer data is gone. Tools that claim to do it are creating new layers from the flat pixels, which is the same rebuilding described in Method 4.
What if a client sent me a flat PSD?
A flat PSD can't be unflattened either. Ask the client for the layered original, or rebuild the elements you need to edit using Method 4.
My History panel doesn't show "Flatten Image"
The flatten step has probably been pushed out of the history. If the file went into a Smart Object, try Method 3. Otherwise your option is Method 4.
How do I increase the number of history states?
Go to Edit → Preferences → Performance (on a Mac, Photoshop → Settings → Performance) and raise History States from the default of 50. A higher number uses more memory, so lower it again if Photoshop slows down.
How to Unflatten an Image in Photoshop - Final Recap
If the file is still open, try Ctrl/⌘ + Z or the History panel. If your layers are in a Smart Object, open it and duplicate them out. If the file was saved flat and closed, rebuild new layers from the pixels. Next time, keep a layered PSD and export flat copies.
Related Tutorials

Hi there! I’m Titto, the creative mind behind FreemiumVisuals. As a designer come digital artist with 10 years of experience, I’ve always been obsessed with creating high-quality visuals.
This blog is my passion project to help creators like you master tools, hacks, and resources that blend affordability with professional results. Whether you’re a hobbyist or a freelance editor, you can utilize this website as your one-stop destination for the latest AI design tool reviews and software tutorials.
Let’s Connect!
📧 Email: [contact@freemiumvisuals.com]
Got a question or idea? Drop a comment on my latest post!
