Sub topic 17
Merging, stamping, and flattening safely
This chapter assumes you can create, select, reorder, and group layers, and that you know the difference between pixel layers, adjustment layers, type layers, shape layers, and Smart Objects. It also assumes you know what the Background layer is. The three operations covered here all reduce the number of layers in a document. They differ in what they keep and what they throw away.
Why combining layers is risky
A layered file is editable because every element is still separate. Combining layers trades that editability for a smaller file, a simpler stack, or a single pixel layer you can filter or paint on. The trade can often be undone only while the document is open and the History panel still holds the step. After you save and close, the combined result is permanent.
The practical rule is to decide what you need to keep before you combine anything. Ask three questions:
- Will I need to change any of these layers later?
- Does the result need to be one layer, or only to look like one?
- Is there a copy of the layered file I can return to?
The three operations
Photoshop gives you three ways to combine layers. They sit in the Layer menu and in the Layers panel menu.
| Operation | What it does | What happens to the source layers | Typical use |
|---|---|---|---|
| Merge Layers / Merge Down | Combines the selected layers, or the active layer and the one below it, into one layer | They are replaced by the merged layer | Joining two pixel layers that belong together |
| Merge Visible | Combines every visible layer into one layer | Visible layers are replaced. Hidden layers stay | Producing one layer from the whole visible stack when hidden layers must survive |
| Stamp Visible | Creates a new layer containing a flattened copy of everything visible | All source layers stay untouched | Sharpening or filtering the final look non-destructively |
| Flatten Image | Combines all layers into the Background layer | Everything is replaced. Hidden layers are discarded | Final export formats that do not support layers |
Merge Down and Merge Layers
Merge Down combines the active layer with the layer directly beneath it. The shortcut is Ctrl+E on Windows and Cmd+E on macOS. If you have selected several layers, the same shortcut becomes Merge Layers and combines all of them.
Several details decide whether a merge behaves the way you expect:
- The merged layer takes the name and blend mode of the lower layer. The upper layer's name is lost.
- If the upper layer had reduced opacity or a blend mode, that effect is baked into the pixels. You cannot change it afterward.
- If the layer beneath is hidden, Merge Down is unavailable or combines with an unexpected layer, so check visibility first.
- Merging a pixel layer into a type or shape layer rasterizes the type or shape. The text can no longer be edited as text.
- Adjustment layers can be merged down into a pixel layer. Their effect on that layer becomes permanent pixels, and the adjustment layer no longer exists.
- Smart Objects and filters on them are also rasterized when merged with a regular layer.
Merge Visible
Merge Visible combines every layer whose eye icon is on. Layers that are hidden remain in the document. This is useful when you have a set of alternative versions or reference layers that you hid on purpose. The shortcut is Shift+Ctrl+E on Windows and Shift+Cmd+E on macOS.
Because the result replaces all the visible layers, you lose the ability to adjust any of them separately. Use it only when you are sure.
Stamp Visible
Stamp Visible does not destroy anything. It adds one new layer at the top of the stack that holds the combined appearance of all visible layers. Photoshop hides this command in the interface. Hold Alt on Windows or Option on macOS while choosing Merge Visible from the Layer menu, or press Shift+Ctrl+Alt+E on Windows or Shift+Cmd+Option+E on macOS.
The same idea works for a selection of layers. Select the layers, then press Ctrl+Alt+E on Windows or Cmd+Option+E on macOS. Photoshop creates a new merged copy and keeps the originals.
Stamping is the safe way to apply operations that need a single flat layer, such as high-pass sharpening, a final noise pass, or a Liquify adjustment on the whole picture. If you want to change the earlier work, delete the stamped layer and edit the originals. Then stamp again.
Flatten Image
Flatten Image merges everything into one Background layer. Any hidden layers are discarded, and Photoshop asks you to confirm that. Transparent areas are filled with white by default. Flattening is required for formats that cannot store layers, such as JPEG, but you do not need to flatten manually for that. When you use Save a Copy or Export, Photoshop makes the flattened output without changing your open document.
The safe habit is to keep a layered master and produce flattened files only as exports.
Choosing the right operation
The decision comes down to what you must be able to change later.
There is a fourth option that does not appear in the table. Converting selected layers to a Smart Object keeps them editable. They appear as one layer in the stack, and you can double-click to open the contents. Filters applied to the Smart Object stay adjustable. If your goal is only to tidy the stack, a Smart Object or a group is often better than a merge.
A safe workflow
- Save the layered document first. Use Save As with a new name if you are about to do something large.
- Check visibility. Turn off any layer you do not want in the result, and confirm that the layers you want are on.
- Check locks. A locked layer can block some operations, so unlock it or choose a different approach.
- Choose the operation from the decision flow above.
- Name the result. A layer called "Layer 14 copy" tells you nothing a week later.
- Inspect the result at 100% zoom before moving on.
If the result is wrong, press Ctrl+Z on Windows or Cmd+Z on macOS straight away. If you have taken more steps, use the History panel to return to the state before the merge.
Scripting a safe stamp
You can automate the stamp-and-name routine with the Photoshop scripting interface. This script runs in Photoshop as an ExtendScript file. It selects the top layer, runs the Stamp Visible action through the action manager, and names the new layer.
// ExtendScript (.jsx): stamp visible layers into a new named layer at the top
var doc = app.activeDocument;
// Make the top layer active so the stamp lands above the whole stack
doc.activeLayer = doc.layers[0];
// Stamp Visible is not exposed as a DOM method, so call it through the Action Manager
var idMrgV = charIDToTypeID("MrgV");
var desc = new ActionDescriptor();
desc.putBoolean(charIDToTypeID("Dplc"), true);
executeAction(idMrgV, desc, DialogModes.NO);
// The new stamped layer becomes the active layer
doc.activeLayer.name = "Stamp - final";The Dplc (duplicate) flag set to true is what turns Merge Visible into Stamp Visible. If you leave it out, the call merges the visible layers and destroys the originals.
Common mistakes
- Flattening before saving the layered version. After you save and close, the layers are gone. Save a layered master first.
- Merging layers with a blend mode and expecting to adjust it afterward. The blend result is baked in.
- Using Merge Visible when you meant Stamp Visible. The two commands look similar in the menu. Check the Alt or Option modifier.
- Forgetting about hidden layers. Merge Visible keeps them, but Flatten Image deletes them after a prompt.
- Merging a type layer to fix a spacing problem. The text becomes pixels, so later copy edits require retyping.
- Leaving an outdated stamp on top. A stamped layer does not update when the layers below it change.
Exercise
You have a document with a sky photo, three adjustment layers, a type layer, and a hidden layer holding an alternate headline. You want to apply a high-pass sharpen to the whole picture without losing the ability to change the adjustments later. Which operation do you use, and what happens to the hidden layer?
Show answer
Use Stamp Visible (Shift+Ctrl+Alt+E on Windows, Shift+Cmd+Option+E on macOS). It creates a new layer at the top with the combined look of all visible layers and leaves every original layer in place, so the adjustments stay editable. The hidden headline layer is not included in the stamp because it is not visible, and it stays in the document untouched.
Exercise
A colleague merges a text layer down into a photo layer with Ctrl+E, then notices a typo. What happened to the text, and what is the quickest fix?
Show answer
Merging rasterized the type layer into pixels, so it is no longer editable as text. The quickest fix is to undo the merge with Ctrl+Z (or step back in the History panel) and correct the typo on the type layer before merging. If the file was already saved and closed, the text must be retyped on a new type layer and the old pixels painted out.