Skip to main content
Photoshake
Known Participant
October 20, 2021
Question

Hardware Question - faster processing for batches

  • October 20, 2021
  • 5 replies
  • 1964 views

I have a simple action that does:

1. Fit Image

2. Save (via a simple script to turn PSD into TIFF)

3. Close 

 

I have used a timer and each image takes about 11 seconds to process the file before opening the next one.

 

My hardware is:

Ryzen 5 2600 (no OC)

32gb DDR4 Ram

AMD 5700 XT GPU

 

I know 11 seconds may not sound like a lot, but over 1000s of images it can be and this is for business purposes so I am happy to spend "smart money" if I will see an increase, but if the difference is neglible then I won't invest. Does anyone have experience with seeing a large performance increase in batch processing for say a faster CPU?

 

I have run a Puget Benchmark and get a score approximately 660 each time, but that doesn't suggest repitive tasks like batch processing.

 

Would love to hear input from anyone who has had similar experience.

This topic has been closed for replies.

5 replies

Legend
October 20, 2021

Try hitting tab to hide all the panels. The panels redrawing takes up some cycles.

JJMack
Community Expert
Community Expert
October 20, 2021

Indeed I use that in script that process many files and script that loops to perform many Photoshop  steps  I do that and also suspend recording history state which are expensive and also wipe the users steps in the history palette.

JJMack
davescm
Community Expert
Community Expert
October 20, 2021

Just a thouht:

Have you checked whether the bottleneck is the opening of the PSD files. If PSDs are stored using compression then they are smaller but take longer to open. That is why I, and many others, disable compression on PSDs. Disk space is cheap, time is not.

 

Dave

JJMack
Community Expert
Community Expert
October 20, 2021

No Compressing would work best if all is on SSD File closing requires that all output is committed. SSD also improve spooling performance.  The Problem is Layered files tends to be large how much SSD storage do they have....

 

Compression may work better on disk for there will be less data spooling to and from disk. Output write behind spooling need to be commited before closet can end.

JJMack
JJMack
Community Expert
Community Expert
October 20, 2021

You PSD file may require some tine to process. If the contains many layer when Fit Image resizes the to fit. All layers that contribute pixels to the composite.  Shape layer via transform Paths, Text layer via Photoshop text processing  Smart Object layer, layer's transform scaling need to be updated and rendered, Pixels layers need to be transformed and rendered. and the output Tiff needs to be saved you 11 second  processed 2 file the input PSD and the Output Tiff. Is the Tiff being saved as a layered tiff. Resizing a layered image files is quite complex.  If You are saving flat Tiff file  before you use Fit Image try Flatting the opened PSD document see if that speeds up processing. Also use Save As to save the Tiff you do not need to add a second script after the fit image script. When you process 1000 PSD you are also creating 1000 Tiff files you process 2000 files.

 

 

 

1. Flatten
2. Fit Image (Its an file Automate Script)
3. Save AS Tiff (No script needed)
3. Close No save

 

Fit Image is a Plug-in script is is required to be recorded in the action. When you record it. During the recording Fit Image will record the setting you use in its dialog into the Action step.  Whet the Action is played Fit Image will be passed those settings by the action manager and  Fit Image will bypass displaying its dialog and use the passed settings.

 

 

JJMack
Photoshake
Known Participant
October 20, 2021

Hi JJ, 

 

Unfortunately flattening is not an option as it is a requirement for the client so their designers can take the elements from the layers.

 

There are no text layers or smart objects in the files for this client, but I do expect vectored files and smart objects to take longer due to Photoshop translating the vectors to pixels when it saves.

 

Cheers,

Dale

JJMack
Community Expert
Community Expert
October 20, 2021

Each none adjustment layer need to scaled via interpolation or via vector scaling and all vector layers need to be rendered so that document composite image can be save. All layer need to be rendered with adjusted layers, layer mask and layer style applied before the documents composite can be blended. You are process both the original opened PSD File and you are encoding a Layered Tiff File.  The Script Code in Fit Image is required for an Action can not calculate what percentage a constrained Image Size would be need for each file  image to fit within some canvas size requirement. An none constrained Image Size to the canvas size requirement would distort images with aspect ration  different than the canvas size requirement. All the Fit Image does is make that calculation to do the  constrained Image Size using the calculated percentage require for each image. The single calulation does not take a long time to make.

 

Are you using Data Compression in your PSD and TIFF.  It may run faster if  you do not decompression and compression require processing  time. How much SSD storage do you have....

JJMack
c.pfaffenbichler
Community Expert
Community Expert
October 20, 2021

Have you tried collecting the whole process in one Scripts and using AM-code instead of DOM-code (if any parts are DOM-code, that is). 

Photoshake
Known Participant
October 20, 2021

Afraid I do not know, this is the script so maybe you will be able to tell me:

 

var doc = app.activeDocument;
var str = doc.name.toString();
var idx = str.indexOf("_");
var sli = str.slice(0, idx + 1);

var tifOptions = new TiffSaveOptions()
with(tifOptions) {

  embedColorProfile = true;
  alphaChannels = false;
  imageCompression = TIFFEncoding.TIFFLZW;
  layers = true;
  layerCompression = LayerCompression.ZIP;
  byteOrder = ByteOrder.IBM;
  transparency = true;

};
doc.pathItems.removeAll();
doc.channels.removeAll();
doc.colorSamplers.removeAll();

doc.saveAs((File(doc.path + "/" + doc.name)), tifOptions, true);
c.pfaffenbichler
Community Expert
Community Expert
October 20, 2021

That’s DOM-code, AM-code usually runs somewhat faster. 

 

But I meant the WHOLE process, so including the fitting and the selection of the files/folders. 

Legend
October 20, 2021

Put everything on fast SSDs. Or use an alternative like ImageMagick.

Photoshake
Known Participant
October 20, 2021

Thank you, Photoshop and the script is on an SSD as is my scratch disk.

 

I just did a test moving the images from my spinning HD to an SSD and found the speed results were the same when I ran the batch.

 

Does ImageMagick allow me to set the parameters of the TIFF file and tell it to remove channels and paths? Is it much faster?