Copy link to clipboard
Copied
I am new to Photoshop scripting. I am trying to edit a batch of images by doing the following:
1. white background layer
2. add 1st image layer
3. add 2nd image layer
4. apply clipping path/mask to 2nd image layer
5. open the file through photoshop to continue editing or save file as a psd
Is it possible to create a script doing the following above? If so, what scripting codes should I use to do so?
Thank you!
Copy link to clipboard
Copied
Adding on to my question. If I am not able to apply the clipping path. I would like to do the following within the script:
1. white background layer
2. add 1st image layer (same image every run)
3. add 2nd image layer (different image every run)
4. open file to apply clipping path manually
Copy link to clipboard
Copied
Forget that you using Photoshop. Describe what you want to do. Do not write in term of editing digital images. Lets just say your have a pile prints and you want to make a set of montages. Describe your mortgages.
To me what you seam to want to do is just simply add a second images to constant first image. That should be very easy to do with Photoshop if all the second image are the same size and have the same Aspect ration and resolution. And you want the second image the be in same location relative to the first constant image. A relatively easy to record action should be able to able to be used to Batch process all your images. All you second images should be in a folder to be batch process with the action you record. Photoshop batch Process would open one image at time your action would add canvas to the opened image to house the First constant image. The Action would then place that image into the added canvas area and the save out populated montage. This processes will be repeated for all the other images being patched processed.. You will only need to add a Layer mask if you need to logically crop your images to a different aspect ration then they have. To create the montage you want to. You need to design what you montage composition will be.
Copy link to clipboard
Copied
Hi whitneyw62210287
What you are doing is fairly straightforward however you need to be slightly more specific with your requirements. Do your existing batch of files already have the paths on them? Could you maybe either send me an example file or two of the files that you want to process?
I can certainly put together a script for you that will do this job quite efficiently.
Also I should point out that if you would like to learn how to do this for yourself, have a look at www.photoshopscripting.com.au, the discount code LRNJS4PS is still active at 25 percent off. Those lessons will step you through all of the concepts you need to be able to make something like this.
I will write something up for you tomorrow and get back to you.
Thanks
James
Copy link to clipboard
Copied
My existing batch of files does not have the paths on them. What I am doing basically is replacing the background of a image. Once I bring the batch of files ( MAIN IMAGE) into photoshop, I add another layer that contains the background image that I am using to replace (BACKGROUND IMAGE). (The background image is the same image for the existing batch of files. In order for me to replace the background of the main image with the background image, I use the magic wand selection tool in all four corners of the main image layer. When refining the edge, smooth is set to 30. The next step is to invert the selection and create a layer mask to the main image layer. I would like the script to leave the file open in photoshop so that I may edit and do any cleaning to it.
Do you have a script to where I can just plug in information.
Hopefully all of this makes sense, I am new to the scripting so I will definitely check out the website.
Thank you.
Copy link to clipboard
Copied
My First append I described an Action you could record to do what you want to batch. Which is to add the same background to a batch of imaged. I also posted a description of my Photo Collage Toolkit which will enable you to populate more complex composite PSD files. If you read the documentation you well see it is very easy to create templates there are only four simple rules. Image are populated in image number ordered stacked above the required background layer size, positioned and mask to shape. If Image 1 mapping alpha channel is Canvas Size. Image 1 would cover all of the Background layers and the other images would be populated in the positions above image 1. You can also control the sequences image files well be populated be rename the image files where to prefix the image original filename with a prefix image sequence number so the images will sort in the order you want them populated. If you choose the can interactively populate template where you can chose the image you want in each location. Once you choose an image the script will place in the image size it, position it and mask it the put you in an interactive Transform where you can tweak the smart object layer's image composition.
Copy link to clipboard
Copied
There are free scripts the can do what you want...
Photo Collage Toolkit
Photoshop scripting is powerful and I believe this package demonstrates this here is a video showing a 5 image collage PSD template being populated with images
The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
There are fifteen scripts in this package they provide the following functions:
Copy link to clipboard
Copied
Steps that I follow:
Open Photoshop – No documents are open. I click “Record” in actions I open my phone.PSD file (which opens up in a tab).
I open the .jpeg files (11 files at a time which open up in their respective tabs)
I click Ctrl+Tab in my phone.psd tab to move to my 1st jpeg file. I select all & copy.
On my phone.psd tab, I do paste of my copied jpeg into a layer above my sleeve layer.
I then do clip mask to create “Create clipping mask” (the jpeg is now shown on the phone layer shape).
I save the work done in the .psd to web -> File -> Save for web -> .jpg
I then delete the clipped jpeg layer on my phone.psd file which makes it ready for clipping of next jpeg.
I then do Ctrl+Tab to move to the jpeg which I had just clipped & closed the tab.
Recording ends.
Now, the problem is that whenever I run this batch, the batch runs fine BUT Photoshop renames the files with the same name and overwrites the previously clipped jpeg. The end result is that only the last clipped jpeg is available and that too with the 1st jpeg name.
Can anybody help me what is wrong or this is possible via js coding? or in the action method.
Michael Peterson
Clipping Path Associate
Copy link to clipboard
Copied
You have most likely recorded your action with a save as step with hard coded file name recorded in the save as steps. If that is the case you need to re-record the Save as step and not change the file name that Photoshop defaults to. That will result in no file name being recorded into the save as step. When that step is played Photoshop will default the file name to the current Documents name. Not a fixed File Name recorded in the save as step. Fully expand the Action so you can see what is recorded for each action step. You do not want the seen any File name recorded in any save as step. Or you need to make the save as step interactive by turning on its dialog so you can set the file name you want to save what the step is played. A Photoshop script not an action could contain logic the set the save as file name. Can you pogram in JavaScript?