Skip to main content
Participating Frequently
May 10, 2021
Answered

Running a Batch (Image Scripting) for Smart Objects

  • May 10, 2021
  • 4 replies
  • 9949 views

Hey guys I wanted to ask how to run a script in CS6 to process multiple images quickly into a Smart Object area, my designs are all Black and White and I'm only replacing a single Smart Object on a background image...I've seen a few Youtube videos explaining the process but I want to either create a simple script myself or find one that I could modify/copy...

My process would be:
Take 250+ images from a single folder (they can be PDFs or JPEGs...what would work better?)
Replace the original smart object with each image one by one.
Match the width, but not the height (some of the images are more square, some are rectangular etc.)

Save as a Jpeg into a new folder


Can anyone advise on this? 

 

Cheers,

 

Ben

 

Correct answer JJMack

I got the process to work so i'm able to batch the images onto the templates...the last thing, using the edits to keep the transformation rotation unfortunately doesn't work ("not safe to edit")

 

I think that's good though i can make the little adjustments needed but having all the images somewhat decent helps a ton

 

Thanks JJMack!


The message not safe to edit means you either have Illustrator vector smart objects or ACR Smart Objects in your Template.  Photoshop can not Edit these. They are edited in AI or ACR.  Therefor they are not compatible with my Photoshop script edit option my scripts can not control the editing Process. Control would be transfer to you in whatever application or plug-in processes vector files or Camera Raw files on your system. Please read the help this is clearly stated in the help.   Those types of smart objects can not be edited in Photoshop. So my script tell you these objects are not safe to edit. You can replace those object via replace content in scripts.  It is suggested that you use use PSB smart objects in templates that is converted  Photoshop layers to smart object layers  or to use Placed PSD files.  Avoid using placed Png and Jpeg files for png files that have transparent borders will be trimmed to the Png's Pixel subjects bounds and Jpeg file do not support transparency or layer which means my script edit processing has to merge all layer basically flatten the object and that will remove any transparency replacement image may have. Placed Raw and Vector  files Smart objects will be skipped if the edit option is used they will not be updated you get the message not safe to edit. Again please read the help.

4 replies

Stephen Marsh
Community Expert
May 22, 2021

@Benjamin5FC1 

 

Did one or more answers in this topic work for you? If so, please mark them as one or more correct answers.

 

Otherwise, where are you at with solving your workflow issue?

Stephen Marsh
Community Expert
May 12, 2021

 

One option is to use one of JJMack's collage scripts:

 

http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.html

 

I'd probably start with a simple script, such as BatchOneImageCollage.jsx 

 

__________

 

Another option is just a "simple" action and batch or image processor or image processor pro worflow.

 

Recorded action steps would be similar to the following, working on a temporary copy of one of the 250 transparent graphic files:

 

1) Trim imge: transparent pixels

2) Fit image command to a targeted max. width and height

3) Canvas size command to resize to the size of the static background image

4) Place the static background image from it's fixed location on your drive

5) Use the relative keyboard shortcut cmd/ctrl [ or another method to move the static background image behind the transparent graphic layer

6) Adjust the X and Y position of the transparent graphic to the desired position

 

Then batch/image processor/image processor pro the action using the x250 graphics, the saved files will be using the filename of the transparent graphic and can have other text as a prefix or suffix.

 

Bojan Živković11378569
Community Expert
May 11, 2021

Hopefully you will solve your problem with @JJMack  script. For the feature just reminder that you can use Data driven graphics or variables to process lots of images and to automatically scale them down to pixel content on given layer. You can only export or save files as PSD but there is only one step to convert all files to any desired format.

Participating Frequently
May 11, 2021

Hi Bojan...i've tried this but i'm only able to change one picture at a time using the pixel replacement variable? what are the steps to do this with multiple images?

JJMack
Community Expert
May 11, 2021

Data driven graphics does not support smart object layers replacement.  Normal image layers and text layers can be changed other layer type only their visibility can be changed.

You should be able to change as many image layer as you like in a Data driven Template you can have many variable layers.   You can not use Smat object layer for image to be able add warping, add perspective distortion etc to the object contents.  

 

 

JJMack
Stephen Marsh
Community Expert
May 10, 2021

I'd recommend JPEG and avoid smart objects unless there is a good reason to use them. Does each of the 250 images already have a different smart object, or is it a common placeholder image? How will the 250 replacement images be matched to the 250 originals?

Participating Frequently
May 10, 2021

So what process would you use to replace an image in the same place every time? I've only seen it done using the Smart Object 

JJMack
Community Expert
May 11, 2021

Ignore the first post...i changed the image names to obj0, obj1 etc and that did the trick...

I'm half way there! I'm still having the issue that the object does not fit into the right fill area and then the next step would be to make sure the proportions remain the same but the width is filled to the edge.


Smart object need to be replaced with object that have  same aspect ratio, size and print resolution as the object in the mockup template. Replace content does  not change the smart object layer's object  transforming, warping and positioning.   If you not have the  correct size replacement objects.  You can use my scripts edit option  if the smart ojects in your template are Photoshop Objects not Illistrator vector smart objects or ACR Smart Objects.  Replacement will be Edited into the existing object. If the replacement objects have the correct aspect the image will fit the object perfectly. If the replacement image has the incorrect  aspect the image will be resized to fill the smart object bounds, some image content will be lost. If you do not want to loose any image content content you can add the fit option in addition to the edit option. The replacement image will be resize to fit within the Smart Object area. There will be boarders on two sides or replacement that have the incorrect aspect ratio.

JJMack