• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Running a Batch (Image Scripting) for Smart Objects

New Here ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

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

 

TOPICS
Actions and scripting

Views

7.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , May 11, 2021 May 11, 2021

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 existin

...

Votes

Translate

Translate
Community Expert , May 11, 2021 May 11, 2021

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

...

Votes

Translate

Translate
Adobe
Community Expert ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

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 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

Is it x1 template and x250 images?

 

Is it x250 images and x250 replacement images?

 

Sample files or cropped screenshots of the layers panel might help to Illustrate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

Just one image and 250 replacements

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

You can use the Photoshop script "BatchMockupTemplates.jsx" from my Free Photoshop Photo Collage and Mockup Toolkit to populate your image files into your Mockup template.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

JJmack...

 

Appreciate the content! 

I can't view the instructions video to run the script? When i run the run the mockup script i get an error:

Required Folders Missing

Destop/Moonlight%20Makers/Screens/obj0

 

What does this mean?

 

I'm able to run the "replaceoneobject" script but the images do not fit into the smart object defined area...rather they cover the whole image.

Any tips?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

It means that you did not set up the job correctly You did not set up the smart object layer replacemet que sub folders obj0, obj1,...,objN use the help button read the scripts set up requirements.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

Also I made a mistake previously and i'm importing 1 single image (A Design) into multiple Templates (100+) right now...

Ideally i'd want to import 5-10 designs into multiple templates at once

The most important thing is i want to create my templates and have the correct script so when any new designs are created we can easily import them into the templates and keep the right proportion and fill the width of the template object.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

Thanks for the heads up...

Right now it's saying Smart Object "not safe to edit"...i assume i've got the wrong Smart object type placed into my background??...very confused here and not sure what direction to go without getting 1 on 1 help from someone sitting next to me 😞

Is there a better way to do this without the smart object feature?

 

Thanks for all you do i see you are very active within the community!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

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.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2021 May 12, 2021

Copy link to clipboard

Copied

Thanks for the sample screenshot. This can be done via batch action or script. There are many examples on the forum, when I have time I'll try to dig up some links.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

Here is how you need to setup things, assuming that you understand basic things how to setup variable and how to load external file. You can use Excel by the way and to export comma separated or tab separated file.

 

File with variable should look like this:

 

PixelVariable1

image001.jpg

image002.jpg

image003.jpg

image004.jpg

and so on...

Extension must match file extension but it is not limited to JPG or JPEG, it can be any supported file format.

 

Use Adobe Bridge to rename images to: image001.jpg, image002.jpg, image003.jpg and so on... By the way you can use any file format supported by Photoshop.

 

Finally the step you are missing: File > Export > Data Sets As Files then choose All Data Sets from Data Set: drop down list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2021 May 12, 2021

Copy link to clipboard

Copied

 

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2021 May 22, 2021

Copy link to clipboard

Copied

LATEST

@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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines