Skip to main content
Participant
August 1, 2020
Question

How to automate replace smart object and create jpg mockup?

  • August 1, 2020
  • 5 replies
  • 8213 views

Hi guys,

Bought a photoshop mockup file from creative market and would like to automatically generate mockups for all my design files.

 

I need to add the PNG files automatically to the mockup using the smart layer.


Any recommendations?

This topic has been closed for replies.

5 replies

Known Participant
October 20, 2023

I've been able to automate the creation of LOTS of mockup images using Photoshop templates that I got from Creative Market. Most of my use-cases have been for product images, specifically.

 

The easiest + fastest way to get this automated is to use the Batch-Replace Smart Objects Photoshop plugin. All you have to do is: Select the Photoshop document to use, select the input folder (of your artwork images), and select the output folder to save your final images to. Then just click "Run" and bam, it's automated, and it'll generate all the images for you automatically.

 

 

Additionally, if you have several mockup images you need to use (for example, you're creating several mockup photos for each product, not just one), you don't need to be there sitting at your computer to manually trigger the automated creation of the different mockup templates one after the other only after the previous one has finished -- instead, you can just create a workflow with multiple steps and it'll run through the whole thing, from start to finish, and create all the mockup images you need in one single automated pass.

 

One other nifty feature of this plugin: If the artwork images in your input folder vary in size, but you want to use the same mockup template to generate the final images? You can select "Stretch Images To Fit Smart Object", and it'll auto-resize all the images so they fit the mockup correctly. Also, manual Smart Object replacement operations often get jacked up if the DPI/resolution of the input image doesn't match the original Smart Object DPI, and this feature accounts for that as well by getting everything to match during the operations.

 

If you're good at writing computer programs, you could write yourself a custom Photoshop script that would functionally do the same thing for you. (If you've never automated stuff in Photoshop via .jsx scripts, this Adobe Scripting Guide is a good starting point.)

 

Your custom script would need to do a few things: 1) Open the specified Photoshop document; 2) Loop through all images in your input folder. For each image in the folder? Replace the Smart Object's contents. Then, export each updated .psd document as a JPEG image; then 3) If needed, loop through all the specified Photoshop documents, if you're using multiple mockup templates (to create several different product photos for each artwork design, for example.)

 

Then once the script is written, you can add it to Photoshop, and it can be accessed and executed via the File > Scripts section. (These can also be set to trigger via Keyboard Shortcuts that you can bind to the different scripts, if you want to execute them that way.)

 

 

Earth Oliver
Legend
February 24, 2022

...

Bojan Živković11378569
Community Expert
Community Expert
August 1, 2020

If you want to use Photoshop actions for automation here is suggested process:

  • Edit Smart Object layer content. This step will be automatically played by Photoshop.
  • Place new design, this step should have modal control on to be able to navigate and place desired design.
  • Adjust and position design.
  • Save and close, this step will be automated.
  • Save file on disc.

For more complex solution you must be very familiar with actions to try it out. What comes to my mind is to have temlate open while running batch. The process is following:

  • Open template in Photoshop.
  • Run batch on files in folder, that will be folder with all your designs. During batch Photoshop will play action:
    • Batch script will open file from folder
    • Copy file using action step
    • Go to previous tab
    • Edit Smart Object content
    • Paste copied content
    • Save and close
    • Copy mockup
    • Go to next tab
    • Paste mockup and delete layer below as needed or desired.
    • That's it, it should work, Photoshop will then save opened file in first step which is batch process in folder of your choice what you can choose in batch dialogue.

 

JJMack
Community Expert
Community Expert
August 1, 2020

Actions would need to be recorded for each template and most likely need to be interactive to be able to select the correct replacement images and also set the output file names.  Action have many limitation for the can not use logic to do thing.  Action are a sequence of Photoshop steps with fixed settings if not interactive.  Interactive action if batched is not a batch process its an interactive process.

JJMack
JJMack
Community Expert
Community Expert
August 1, 2020

For automatic population:

1.  Your template may need to be altered to facilitated automatic population.

2   Replacement need to be the correct size.

3.  If you PNG images have full transparent boarders the may need to be altered

4.  Replacements may need to be ordered.

 

There is no standard Mockup format. Some Photoshop features will trim transparent boarders. Replacement Object need to be the same Size as the objects in the mockup template to match the existing smart object layer's object transform that scaled, positions and distort the object for the mockup content. If there are multiple smart object layers. The replacement objects ques need to be ordered so the right set of replacement are populated int the template. 

JJMack
c.pfaffenbichler
Community Expert
Community Expert
August 1, 2020