Sub topic 13
Nested groups and a tidy file structure
This chapter assumes you can already create layers, select several at once, and make a single group with Ctrl+G (Windows) or Cmd+G (macOS). Here you will put groups inside other groups, decide how to structure a large file, and automate the setup with a script.
Why nest groups
A group is a folder in the Layers panel. A group can contain other groups, and that is called nesting. A document with 80 layers in one flat list is hard to navigate. The same 80 layers in six top-level groups, each holding a few subgroups, can be scanned in seconds.
Nesting also gives you one control over many layers. Hiding a group hides everything inside it. Moving a group moves its contents together. Setting a group's opacity changes how the whole bundle composites. You can apply each of these at any level of the hierarchy.
How to nest groups
You can nest groups in four ways:
- Group a group. Select an existing group in the Layers panel and press Ctrl/Cmd+G. Photoshop wraps it in a new parent group.
- Drag a group into another. Drag a group onto an expanded group until a highlighted line appears between its children, then release. Dropping it directly on the folder row also works.
- Create inside an open group. Select a layer that is already inside a group, then add a new group. The new group appears next to the selected layer, inside the same parent.
- Use the dialog. Alt/Option-click the folder icon at the bottom of the panel to open the New Group dialog. There you can set the name, color label, mode, and opacity before the group is created.
To undo nesting, select the parent group and press Shift+Ctrl/Cmd+G. This ungroups one level only. The children stay in place and the parent folder disappears.
Photoshop allows up to 10 levels of nesting. In practice you rarely need more than three. Deeper structures make it slow to find a layer, because you must open every level on the way down.
A structure you can reuse
A good structure follows how you think about the image, not how you happened to create it. A common pattern for a composite is to group by subject first, then by role:
- Top level: one group per major part of the image (Subject, Background, Lighting, Type, Final Adjustments).
- Second level: groups for roles inside a part (Retouching, Color, Shadows).
- Leaf level: the actual pixel, adjustment, and type layers.
Keep the stacking order in mind as you design this. The panel composites from bottom to top, and a group occupies a single position in its parent's list. Everything inside the group is composited together, then that result takes the group's place in the stack. So moving a group up or down changes how all of its contents relate to the layers around it.
Naming and labeling at scale
Names carry the structure when the panel is long. Follow these habits:
- Name every group when you create it. "Group 14" tells you nothing.
- Use a noun for the content ("Subject") or a verb phrase for the job ("Dodge and burn"). Pick one style and keep it.
- Use color labels on the group row, not on every child. Red for finals, blue for lighting, and so on works well. A color on a group shows at a glance where you are in a collapsed panel.
- Add a numeric prefix ("01 Background", "02 Subject") only if you need a fixed reading order. Remember it does not change the stacking order. The panel position does.
Navigating a deep file
Four panel features help most in a nested file:
- Collapse and expand. Click the arrow beside a group. Alt/Option-click the arrow to expand or collapse every nested subgroup at once.
- Filter. Use the search and filter bar at the top of the panel to show only layers of one kind, name, or color.
- Auto-select. With the Move tool, Ctrl/Cmd-click a pixel on the canvas to select the layer under it. The panel jumps to that layer and opens any groups around it.
- Solo a layer. Alt/Option-click an eye icon to hide everything else. Alt/Option-click again to restore the previous state.
Locking and visibility inside groups
Locks set on a group apply to the layers inside it. If you lock a group's position, you cannot move its contents until you unlock it. This is useful for a finished "Background" group that you do not want to nudge by accident.
Hiding a group works as a master switch. If a parent is hidden, its children cannot show, even if their own eye icons are on. The reverse is also true. A visible group does not make a hidden child appear.
Blend modes on groups
A new group uses the Pass Through blend mode. In Pass Through, the group has no effect of its own on how its children blend. Each child layer, such as an adjustment layer or a Multiply layer, still interacts with everything below the group, as if the folder were not there.
If you change the group to any other mode, including Normal, Photoshop first composites the group's contents on their own. It then blends that single result with the layers below. As a result, an adjustment layer inside the group affects only that group's layers, not the rest of the document. Use this to contain an effect. Leave it on Pass Through when you want the effect to apply to the whole image under it.
Automating a nested structure
When you start many files with the same skeleton, a script saves time. This ExtendScript (.jsx) creates a parent group, adds two subgroups inside it, and puts a new layer in each.
// ExtendScript (.jsx): build Subject > Retouching and Subject > Color, each with one layer
var doc = app.activeDocument;
var subject = doc.layerSets.add();
subject.name = "Subject";
var retouch = subject.layerSets.add();
retouch.name = "Retouching";
var color = subject.layerSets.add();
color.name = "Color";
var skin = retouch.artLayers.add();
skin.name = "Skin cleanup";
var tone = color.artLayers.add();
tone.name = "Tone";Calling layerSets.add() on the document makes a top-level group. Calling it on a group makes a nested one. To move an existing group into another, use group.move(parentGroup, ElementPlacement.INSIDE).
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Colors change after grouping | The group's blend mode is not Pass Through | Set the group back to Pass Through |
| A layer will not appear although its eye is on | A parent group is hidden | Turn on the parent group's eye |
| A new group lands in the wrong place | A layer inside another group was selected | Select the top-level item first, then add the group |
| The panel is hard to read | Every group is expanded | Alt/Option-click an arrow to collapse the nested groups |
| A layer cannot be moved | A lock on it or on a parent group | Check the lock icons on the layer and its parents |
Exercise
A document has a group named "Lighting" set to Normal. Inside it is a Curves adjustment layer that darkens the image, but the layers below the group are not darkened. What is the cause, and how do you make the Curves layer affect the whole image?
Show answer
The Normal blend mode makes Photoshop composite the group's contents on their own before blending the result with the layers below. The Curves layer therefore adjusts only the layers inside "Lighting". Change the group's blend mode to Pass Through so the adjustment reaches everything beneath the group.
Exercise
Write the ExtendScript line that moves an existing group stored in the variable lighting into another group stored in the variable scene.
Show answer
lighting.move(scene, ElementPlacement.INSIDE);