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.
The Honest Answer
"How do I unflatten my Photoshop image?" is actually four different questions, depending on one critical factor: whether the file has been saved and closed since flattening.
Most tutorials skip this distinction entirely. If your file is still open in the same session, all your layers are fully recoverable in seconds. If the file was saved, closed, and reopened, the original layer data is permanently gone — no plugin, no AI tool, no software can restore it. What you can do in that case is reconstruct new layers from the flat pixels, which is a meaningful but different thing.
This guide covers all four scenarios honestly, in order of how often people actually encounter them.
If you saved a JPEG, PNG, or flat PSD and closed it, the original layers are gone permanently. The pixel data was merged and the layer metadata was discarded at save time. No tool, plugin, or AI can restore it. What you can do is reconstruct — see Method 4.
Undo — Instant Layer Recovery
If flattening was the last — or one of the last — actions you took in this Photoshop session, a single keyboard shortcut restores all your layers exactly as they were.
This undoes the last action. If flatten was the last thing you did, a single press restores all layers immediately. The Layers panel will repopulate with every layer exactly as it was before the flatten.
If you made other edits after flattening and need to step further back, hold Alt (Win) or Option (Mac) while pressing Ctrl/Cmd + Z to undo multiple steps in sequence.
The moment your layers are back, go to File → Save As → Photoshop (.PSD) before doing anything else. This locks your recovered layers into a file that will survive closing Photoshop.
💡 By default Photoshop stores 50 history states. If you've made more than 50 changes since flattening, earlier states may have been pushed out. Increase this to 200 in Edit → Preferences → Performance → History States.
History Panel — Jump Back to Any State
The History panel lets you jump to any recorded state in the current session — including the state before you flattened — regardless of how many edits you've made since.
Go to Window → History. You'll see a chronological list of every action taken in the current session, from top (oldest) to bottom (most recent). The panel is usually docked alongside Layers and Channels.
Scroll through the history states until you see the entry labelled "Flatten Image". This marks the exact moment all your layers were merged into a single pixel layer.
Click on the history state directly above (before) the Flatten Image entry. Photoshop instantly reverts to that point — your layers reappear in the Layers panel exactly as they were.
⚠️ Any actions you took after flattening will be lost when you revert. If you did significant editing after the flatten, decide carefully whether undoing the flatten is worth losing that work.
Go to File → Save As → Photoshop (.PSD) and save. This preserves your recovered layers in a format that survives closing Photoshop.
By default, reverting to a history state removes all subsequent states. Enabling Non-Linear History lets you branch from any state without deleting later ones. Go to History panel menu (three-dot icon, top-right) → History Options → check "Allow Non-Linear History". This is useful for comparing what an image looks like with and without the flatten without permanently losing either version.
"The undo history only survives while Photoshop stays open. The moment you close the document, that history is gone — and with it, your only native path back to the original layers."
Extract from a Smart Object
A Smart Object is fundamentally different from a regular flatten. When you merge layers into a Smart Object, Photoshop wraps the original layers inside a container and embeds them — the layer data still exists and can be extracted. Identify a Smart Object by the small page icon in the bottom-right corner of the layer thumbnail in the Layers panel.
In the Layers panel (Window → Layers), double-click the thumbnail image of the Smart Object layer — not the layer name. This opens the Smart Object's contents in a separate document window (it will have a .psb extension in the title bar).
In the new .psb document window, click the top layer in the Layers panel, then Shift-click the bottom layer to select them all. You'll see all your original layers listed exactly as they were before the merge.
Click the three-dot panel menu in the top-right corner of the Layers panel and choose "Duplicate Layers…". In the dialog, select your original document from the Document dropdown. Click OK — all layers are copied across.
Switch back to your original document. All layers from the Smart Object are now present. Close the Smart Object window without saving (no changes needed inside it). Delete the original Smart Object layer — it's no longer needed. Save as PSD.
💡 Going forward, use Convert to Smart Object (right-click layers → Convert to Smart Object) instead of Flatten Image — it compresses without destroying layer recoverability.
Reconstruct Layers from a Saved Flat File
If the file was saved and closed, the original layer data is permanently gone. What you can do is manually reconstruct separate editable layers from the flat pixel data using Photoshop's AI-powered selection tools and Content-Aware Fill. This is not unflattening — it is rebuilding. The quality depends on the complexity of the image and how precisely you need to separate elements.
Open your flat JPEG, PNG, or PSD in Photoshop. In the Layers panel, the image will appear as a locked Background layer. Double-click it to convert it to a regular unlocked layer (rename it "Original" and click OK). Immediately duplicate this layer (Ctrl/⌘ + J) as a safety backup before touching anything.
Go to Select → Subject. Photoshop's AI analyses the image and automatically selects the primary subject. For a person against a background, this usually produces an excellent selection in seconds. Alternatively, use Edit → Remove Background (Photoshop 2024+) — one click, transparent background output, no manual selection needed.
With the selection active, go to Select → Select and Mask (or press Alt + Ctrl/⌘ + R). Use the Refine Edge Brush to paint over hair, fur, or complex edges. Set Output to "New Layer with Layer Mask" — non-destructive, fully adjustable later.
With the subject selected, press Ctrl/⌘ + J to copy the selection to a new layer. Rename it descriptively — "Subject", "Person", "Product". Repeat this process for each distinct element you need to separate.
On the original layer, the area where the subject was removed is still showing the underlying pixels. Ctrl/⌘-click the subject layer thumbnail to load its selection, expand it slightly (Select → Modify → Expand → 5–10px), then on the original layer go to Edit → Fill → Content-Aware. Photoshop intelligently fills the gap.
💡 For complex backgrounds, open Edit → Content-Aware Fill workspace for a sampling brush and live preview — much better results than the basic fill.
When painting or cloning to fill gaps, press I to activate the Eyedropper Tool. In the Options bar, set Sample Size to "3 by 3 Average" for the most representative colour sample rather than a single pixel value.
The result of Method 4 is a new set of layers built from pixel information — not the original layer data. Text becomes a raster image, not an editable text layer. Layer effects are baked into pixels. Gradients become pixel approximations. For client work, communicate clearly that you're rebuilding, not restoring — confirm whether reconstruction is sufficient or if a fresh PSD from the client is needed.
Photoshop AI Tools That Help Most
Photoshop CC 2023 onwards added several AI features that make reconstructing layers from flat images meaningfully faster and more accurate. These don't restore original layer data — but they dramatically reduce the manual work involved in 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 CloudHow to Identify Fonts in a Flat Image
Text is one of the hardest elements to reconstruct from a flat file — what looks like clean typography is actually baked-in pixels with antialiasing. Photoshop's Match Font tool is the fastest route to identifying the typeface so you can recreate it as an editable text layer.
Use the Rectangular Marquee Tool (M) to draw a selection around the text you want to identify. Include only one line at a time — multi-line selections confuse the AI. The cleaner and higher-resolution the text, the better the result.
Go to Type → Match Font. Photoshop analyses the selection and returns a ranked list of matching fonts — both installed on your system and available via Adobe Fonts. Select the closest match and click OK.
Select the Type Tool (T), click on the canvas, and type the text. Use the Character panel (Window → Type → Character) to match font size, tracking, and leading. Use the Eyedropper (I) to sample the exact text colour from the flattened image. Position the new text layer over the flat version and mask or hide the original.
💡 If Match Font doesn't find an exact match, try WhatFontIs.com or Font Squirrel's Matcherator — upload a screenshot of the text for external identification including free alternatives.
How to Prevent This From Happening Again
Every minute spent reconstructing a flattened image is a problem that good saving habits eliminate entirely. These practices cost nothing and prevent every scenario in this tutorial from ever occurring again.
| Practice | What It Does | Layers Preserved? |
|---|---|---|
| Save as PSD before flattening | Keeps the layered original separate from the export | ✓ Always |
| File → Export → Export As for JPEG/PNG | Exports a flat copy without touching or flattening the source document | ✓ Source untouched |
| Merge into Smart Objects instead of flattening | Keeps original layers embedded and extractable at any time later | ✓ Recoverable |
| Increase History States to 200 | Gives you a much larger undo buffer within the current editing session | ✓ More undo depth |
| File → Save (overwriting after flattening) | Overwrites the PSD with the flattened version — permanent, no recovery possible | ✗ Layer data lost |
| Closing Photoshop after flattening | History states are discarded on close — undo is unavailable after reopening | ✗ History gone |
Never use File → Save when working on a layered PSD — always use File → Save As when creating a flat export. Better still, use File → Export → Export As (Shift + Ctrl/⌘ + Alt + W) which produces a flat copy without touching the source document at all. Your PSD stays layered. Your JPEG/PNG export gets what the client needs. You never face this problem again.
Common Questions & Fixes
Does Photoshop have an unflatten command?
No. The Layer menu includes "Flatten Image" but has no reverse equivalent. The only native recovery options are Undo (Ctrl/Cmd+Z) and the History panel — both of which only work while the document remains open in the current editing session. Once Photoshop is closed or the file is saved flat and reopened, no built-in command can restore the original layers.
Can any plugin or software unflatten a saved JPEG?
No plugin or standalone software can reconstruct original layer data from a saved JPEG, PNG, or flat PSD. The pixel data was merged and the layer metadata was discarded at save time. Any tool claiming otherwise creates new layers from the flat pixels — which is the same manual reconstruction described in Method 4, not actual unflattening.
What if I received a flat PSD from a client?
A flat PSD is no different from a JPEG in terms of recoverability — if the layers were merged before saving, they're gone. Your options are: ask the client for the original layered PSD, or use Method 4 (AI-assisted reconstruction) to rebuild the elements you need to edit. Always request layered source files from clients upfront — a flat PSD delivery is a workflow error, not a Photoshop limitation.
Can I use Photoshop's Generative AI to fill gaps after separating elements?
Yes — and this is one of the most effective uses of Generative Fill. After isolating a subject to its own layer, select the gap area on the background layer, then go to Edit → Generative Fill and leave the text prompt empty for natural results. Photoshop generates content that matches the surrounding texture, colour, and style — often more convincingly than Content-Aware Fill on complex scenes.
How do I separate text from a flat image if Match Font doesn't work?
If Match Font fails, try: increasing the selection size (more letter area = better AI recognition); sampling from a high-contrast area of the image; using WhatFontIs.com or FontSquirrel Matcherator as external tools with an uploaded screenshot. As a last resort, manually identify the font style (serif/sans-serif, weight, letter-form details) and search Adobe Fonts for a visual match — browsing by classification is faster than keyword search for visual identification.
How do I increase the number of history states in Photoshop?
Go to Edit → Preferences → Performance (Windows) or Photoshop → Settings → Performance (Mac). Find the History States field and increase it from the default of 50 to a maximum of 1,000. A value of 100–200 is practical for most workflows. Be aware that higher history state counts consume more RAM — if Photoshop performance degrades after increasing this, reduce it back to 100.
My History panel doesn't show "Flatten Image" — what happened?
This means the Flatten Image action happened before the oldest visible state in the panel — it was pushed out of the history buffer because the default limit of 50 states was exceeded. If you made more than 50 actions after flattening, the flatten entry is no longer recoverable via the History panel. Your options at this point are Method 3 (if the file was merged to a Smart Object) or Method 4 (reconstruction from the flat pixels).

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!
