Copy link to clipboard
Copied
I have recently been experimenting with scripting image stacking, i.e. variable multiple quantities of file sets into a single file (this could be 2, 3, 4 or more images). The source could be a single or multiple input folders and the script will create stacked images with layers correspondng to the variable quantity variable.
I have been thinking of the pros/cons of all the different methods to stack files. This briefly came up in another topic thread today, which has prompted me to make this new topic:
_________________
PS thanks for pointing out to that script, i already have his scripts collection from github. I noticed he used the place command. I implemented that now i my version as well. That was a huge speed up. It went from 36.8 seconds to 16.4 seconds for 15 images. Thats half the time, huge speedup 🙂 nice!!!
By @schroef
Placing or replacing / linking Smart object give you fastest acceleration.
By @Kukurykus
_________________
Off the top of my head, there are many different ways to transfer one file into another when scripting:
1) Copy/paste
2) Place image as smart object
3) Layer/duplicate
4) Calling the Adobe Load Files Into Stack script
5) Apply image
6) ... ?
I'm curious if anyone tested this or has anecdotal evidence of speed differences between the various approaches? With multipe options, does one stand out as better than the others for speed or perhaps other criteria? There are pros/cons between each method which may require additional steps or work-arounds depending on further processing steps are required once file sets have been created.
Copy link to clipboard
Copied
When we talk about unopen files then method 2 wins. 3 may be faster than 1 but it involves 2 open documents while 4 is old script that used 1 or/and 2 methods. 6 would be writing image binaries to unopen file that need advanced skills. I'm only curious how you could do it using Apply Images as I never used it and didn't think it can be used for this goal.
Copy link to clipboard
Copied
That is a good place to start - placing as a smart object. With one or more input list/s of files, subsequent files can be placed without opening into an open document, or the file can be opened. The advantages of placing a smart object directly into the target document from the input list is that the file does not need to be opened into Photoshop and that the layer name uses the original filename without the extension. The disadvantages of using a smart object are the natural overheads with smart objects and potentially extra steps to rasterize to use the layer with later processing steps.
I used Apply Image in the following script as I was having problems with Place working as intended.
In this case all I needed to do was replace the selected layer in the target doc with a single layer from the source doc. Although both docs need to be open, no clipboard is used.
Copy link to clipboard
Copied
There are so many factors when dealing with the images user have and what the want to do with them. Each method has ramifications. Place may scale objects. Where copy and paste will not scale images. Load file into a stack cans stack images that vastly different canvas sized alignment layer can be a beast. Getting image into a document is only one step in the Process if the method used requires you to perform additional steps those step are part of you performance.
Copy link to clipboard
Copied
That is correct, there are many variables after the image is stacked, which may in turn dictate which method is used to stack. I was just hoping to explore the different available methods and the pros/cons for each.
Copy link to clipboard
Copied
...
4) Calling the Adobe Load Files Into Stack script
...
By @Stephen Marsh
And what is the speed of the Load Files into Stack script for the same number of files?
It uses a special object - ViewlessDocument. Maybe it works quickly.
Copy link to clipboard
Copied
Thank you for noting the "ViewlessDocument" object used in the script, I see that xbytor makes use of this in various scripts.
I have to first build scripts for each different method of combining and compare the speed. A to-do list task and rainy day project!
Copy link to clipboard
Copied
Thank you for the replies so far!
I'll look into them on the weekend when I hopefully have some more free time.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more