How to Unflatten an Image in Photoshop (2026) — Every Method Explained
Photoshop Tutorial · Layers & Recovery · 2026

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.

Skill level: Beginner–Intermediate Time: 1–10 minutes Version: Photoshop CC 2022–2026 ⚠ Read the honest answer first
If file is still open
Ctrl/Cmd + Z restores layers instantly
Made edits since flatten
History panel — click state before Flatten Image
Merged to Smart Object
Double-click thumbnail → extract layers
Saved & closed JPEG/PNG/PSD
Reconstruction only — original layers are gone permanently
Read This First

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.

⚠️ The Hard Truth

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.

Method 1 of 4 — Fastest

Undo — Instant Layer Recovery

1
You just flattened and haven't done much else since
Photoshop is still open with the same document
Fully recoverable

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.

1
Press Ctrl + Z (Win) or Cmd + Z (Mac)

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.

Ctrl + ZWindows ⌘ + ZMac
2
Step back multiple actions if needed

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.

Ctrl + Alt + ZStep back (Win) ⌘ + Option + ZStep back (Mac)
3
Save as PSD immediately

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.

How To Merge & Unmerge Layers in Photoshop — Full Guide
Method 2 of 4

History Panel — Jump Back to Any State

2
You made more changes after flattening
File is still open but Ctrl+Z won't undo far enough
Fully recoverable

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.

1
Open the History Panel

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.

2
Find "Flatten Image" in the list

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.

3
Click the state immediately ABOVE it

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.

4
Save as PSD immediately

Go to File → Save As → Photoshop (.PSD) and save. This preserves your recovered layers in a format that survives closing Photoshop.

💡 Enable Non-Linear History for More Flexibility

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."

— Freemium Visuals, June 2026
Method 3 of 4

Extract from a Smart Object

3
Layers were merged into a Smart Object — not flattened outright
The Layers panel shows a thumbnail with a small page icon in the corner
Fully recoverable

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.

1
Double-click the Smart Object thumbnail

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).

2
Select all layers inside the Smart Object

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.

3
Duplicate layers to the original document

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.

4
Return to the original document and clean up

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.

How to Unmake a Smart Object in Photoshop — Recover Embedded Layers
Method 4 of 4 — Saved & Closed

Reconstruct Layers from a Saved Flat File

4
File was saved and closed as JPEG, PNG, or flat PSD
True unflattening is impossible — this is manual reconstruction only
Reconstruction only — original data gone

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.

1
Open the file and unlock the Background layer

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.

2
Use Select Subject or Remove Background

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.

3
Refine the selection edge

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.

4
Copy each element to its own layer

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.

5
Fill the gap with Content-Aware Fill

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.

6
Sample colours precisely with the Eyedropper

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.

⚠️ This Is Reconstruction, Not Recovery

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.

Can You Unflatten a Digital Image After Saving? — The Reality Explained
AI-Powered Tools

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 Cloud
🎯

Select 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 versions
🔍

Match 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 versions
🖌️

Neural Filters

For colour matching, Smart Portrait adjustments, or style transfer on reconstructed layers. Useful for matching skin tones when recompositing portrait elements.

Requires Creative Cloud
How to Unflatten an Image in Photoshop — Full AI Workflow
Bonus — Text Recovery

How 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.

1
Draw a tight selection around the text

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.

2
Run Type → Match Font

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.

3
Recreate the text layer

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.

Prevention

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
✓ The Golden Rule

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.

FAQ

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).

Freemium Visuals · Photoshop Tutorial · Last updated June 2026. Steps verified in Photoshop CC 2025. Applies to all Creative Cloud subscriptions on macOS and Windows.