Sub topic 12
Building Variations and Reusing the Mockup
This chapter assumes you can build a placeholder smart object, edit its contents, and replace them with Replace Contents. It also assumes you know the difference between embedded and linked smart objects and have set up shadows and highlights above the placeholder. Here you will turn one finished mockup into many outputs without breaking it.
What a variation is
A variation is a version of the mockup that differs in one controlled way. The scene stays the same. Typical variations are:
- A different design in the same placeholder, such as ten posters.
- A different color for the product or the background.
- A different scene angle or crop.
- A different product size, such as a small and a large print.
The aim is to change as little as possible per variation. Each extra change is another chance to break alignment or lighting.
Decide what varies before you build
Plan the mockup as a template with fixed parts and variable parts. Fixed parts are the photo, the perspective fit, the shadow and highlight layers, and the color settings. Variable parts are the placeholder contents, a color layer, and optionally a background.
| Part | Fixed or variable | How to keep it safe |
|---|---|---|
| Product photo | Fixed | Keep at the bottom of the stack. Do not edit. |
| Placeholder smart object | Variable contents | Replace Contents keeps the transform. |
| Shadow and highlight layers | Fixed | Clip them above the placeholder or put them in a group. |
| Color fill or Hue/Saturation layer | Variable settings | Use an adjustment or fill layer, not pixel edits. |
| Background | Variable | Put it in its own group with a visibility toggle. |
Three ways to produce variations
Replace Contents
This is the main method for artwork. Select the placeholder, choose Layer > Smart Objects > Replace Contents, and pick the new file. Photoshop keeps the transform, the filters and the layer effects. It does not keep the old artwork's relative size, so the new file should match the size of the original contents. If the new file has different pixel dimensions, it is scaled to fit inside the old bounds, which can leave empty margins or look softer.
To avoid surprises, give every design file the same canvas size, resolution and color profile. A design canvas that matches the placeholder's contents document lets Replace Contents line up exactly.
Layer Comps
Layer Comps store a snapshot of layer visibility, position and appearance. They are the right tool when a variation changes which layers are on, such as a white mug versus a black mug.
- Set the document to the first variation.
- Open Window > Layer Comps.
- Click the new comp button and name it, for example
Mug-White. Tick Visibility, Position and Appearance. - Change the document to the next variation and create a second comp.
- Click the box beside a comp to apply it.
Layer Comps do not store the contents of a smart object. They record the state of the layers in the main document. Swapping artwork inside a smart object is not captured by a comp, so combine comps with Replace Contents for full variations.
Layer Groups with visibility toggles
For a few variations, group each version and show one at a time. This is simple but gets heavy. Every duplicated group adds layers and file size, and a change to the shared parts must be repeated in each copy.
Reusing the same artwork in several places
Sometimes one design appears in several spots, such as the front and back of a box, or three identical cards. You have two options.
- Duplicate the layer with Layer > New > Layer via Copy. The copy still points to the same embedded contents. Editing one updates all copies, because they share one contents document.
- Layer > Smart Objects > New Smart Object via Copy. This creates an independent smart object. Editing one does not change the other.
Use the shared copy when the design must stay identical. Use New Smart Object via Copy when each position needs different art.
Keeping variations consistent
Consistency across variations comes from three habits.
- Name layers clearly. A placeholder named
Artworkis easy to find, and scripts depend on stable names. - Match design files. Same pixel size, same resolution and the same profile, for example sRGB. A mismatched file will shift color or scale after replacement.
- Keep adjustments outside the placeholder. Color changes belong on a fill or adjustment layer, so a replacement never wipes them.
Linked smart objects help here. If the artwork lives in separate files, you can update many mockups by editing one source file and using Layer > Smart Objects > Update Modified Content. Keep the links relative by storing mockup and art in a predictable folder structure. A missing link shows as a warning icon and needs Relink to File.
A color variation workflow
Color variations are usually faster than artwork variations, since you do not need new files.
- Create a solid color fill layer above the product shape, or use a Hue/Saturation adjustment clipped to the product.
- Set its blend mode to Color or Multiply, depending on whether the product is light or dark.
- Name it
Product Color. - Double-click the layer thumbnail to open the color picker and enter a new value.
- Record each color as a Layer Comp, or note its hex value in your export list.
Color mode keeps the highlights and shadows of the product and changes only hue and saturation. Multiply darkens, so it works only on light bases such as white products. On dark products, neither mode gives a bright result, so you may need a different base photo.
Saving the template
Keep one clean master and never work on it directly.
- Save the master as a PSD or PSB with a name such as
mug-mockup-master.psd. - For each batch, use File > Save As to create a working copy, and keep the master untouched.
- Use PSB when the file exceeds the 2 GB PSD limit. Large embedded smart objects can push a file over it.
- Flatten nothing. Flattening removes the placeholder and ends the reuse.
If you share the template, leave a short note layer or a text file explaining which layer to replace. A locked, clearly named placeholder reduces mistakes for other users.
Common problems with variations
| Symptom | Likely cause | Fix |
|---|---|---|
| New design looks stretched | Design file has a different aspect ratio | Resize the design canvas to match the placeholder's original contents |
| New design looks soft | Design file has fewer pixels than the original | Supply artwork at the same or higher pixel size |
| Colors shift after replacement | Different color profile in the new file | Convert the design to the mockup's profile first |
| All copies changed at once | Layers shared one contents document | Use New Smart Object via Copy |
| Layer Comp lost its state | Layer was added after the comp was created | Update the comp with the Update Layer Comp button |
| Link warning icon | Linked source moved or renamed | Use Relink to File |
Automating a batch
When you have many designs, a loop over the design folder produces all variations. The script below replaces the contents of a top-level smart object named Artwork for each PNG in a folder and saves a JPEG for each.
#target photoshop
var doc = app.activeDocument;
var artFolder = new Folder("~/mockups/art");
var outFolder = new Folder("~/mockups/out");
if (!outFolder.exists) { outFolder.create(); }
var files = artFolder.getFiles("*.png");
for (var i = 0; i < files.length; i++) {
doc.activeLayer = doc.layers.getByName("Artwork");
var desc = new ActionDescriptor();
desc.putPath(charIDToTypeID("null"), files[i]);
desc.putInteger(charIDToTypeID("PgNm"), 1);
executeAction(stringIDToTypeID("placedLayerReplaceContents"), desc, DialogModes.NO);
var baseName = decodeURI(files[i].name).replace(/\.png$/i, "");
var outFile = new File(outFolder + "/" + baseName + ".jpg");
var opts = new JPEGSaveOptions();
opts.quality = 10;
doc.saveAs(outFile, opts, true, Extension.LOWERCASE);
}The true argument to saveAs saves a copy. After a copy is saved, the open document stays a PSD and the loop can continue. Without that flag, the document would become a JPEG and the next pass would fail.
Checklist before you hand off a template
- The placeholder has a clear name and is at the top level, or you know its group path.
- Shadows and highlights sit above the placeholder and are not inside it.
- Color adjustments are separate layers.
- Linked files, if any, use paths that survive a move, or the folder travels with the PSD.
- A test replacement with a different design looks correct at full size.
Exercise
You have a mockup with one embedded smart object named Artwork. You duplicate it with Layer via Copy to show the same design on a second surface. Later you use Replace Contents on the second copy and find the first copy changed too. Why did this happen, and how would you set up the two surfaces so they can hold different designs?
Show answer
Layer via Copy creates a second layer that shares the same embedded contents document, so replacing contents on one replaces them for both. To keep them independent, use Layer > Smart Objects > New Smart Object via Copy, which makes a separate contents document. Then Replace Contents on one copy leaves the other unchanged.
Exercise
A batch script replaces the Artwork contents with 30 PNG files. Most outputs look right, but five show a color shift and soft edges. What two properties of those five files should you check, and what would you do about each?
Show answer
Check the color profile and the pixel dimensions. If the profile differs from the mockup's profile (for example Adobe RGB instead of sRGB), convert the file to the mockup's profile before replacement. If the pixel dimensions are smaller than the original contents, supply the artwork at the same or larger size so Replace Contents does not upscale it.