Skip to main content
DChristop
Participating Frequently
April 7, 2015
Question

Resizing for export filter and batch support

  • April 7, 2015
  • 2 replies
  • 459 views

Hi essentially I have two questions.

I am working on an export plugin for a compressed format. This formats needs the images either as powers of two or aligned to boundaries of 4.

Therefore I would need to resize the exported image before compressing it.

1) Is there any SDK functions which takes an image buffer, resizes it and returns its contents? Can the Photoshop SDK do the resize for me when I create a Export plugin?

2) In order to be able to process many images, do I have to create something special for batch support? Besides creating photoshop actions which dont need the sdk, is there also another sdk way of being able to process multiple images? Maybe an automation plugin?

Thanks in advance

Dimi 

This topic has been closed for replies.

2 replies

Tom Ruark
Inspiring
April 13, 2015

#1. No, no resizing API available. Use an automation plug-in to run the Photoshop resize command then send that to your export plug-in.

#2. You need to not pop dialogs and support actions. Batch runs on top of actions. An automation plug-in is a way to run on multiple images. Think of it as your own batch routine.

DChristop
DChristopAuthor
Participating Frequently
April 14, 2015

Hi thanks for the answers.

Let me recap my understanding

1) You can do batching using Photoshop inherent functionality (Automate->Batch). This means that your plugin must support actions and not pop UI controls.

Is there any example in the SDK that supports actions? What if your exporter can have paramaters, can you somehow pass these into the actions?

Or

2) Use an Automation plugin to gather the documents from a folder or the open documents and pass them into the export plugin.

Is the above correct?

Thanks

Dimi

Tom Ruark
Inspiring
April 14, 2015

#1. Most all examples support scripting. Look for HasTerminology + aete resources and the code that reads/writes scripting paramaters. An automation plug-in and even scripts can support being actionable.

#2. while (docsinfolder) { open, export, close }

Participating Frequently
April 9, 2015

I can't answer your first question, but I have used automation plug-ins for batch support in Photoshop.  I use them for batch operations on layers before exporting (hiding certain layers, merging certain layers, etc.), but the plug-ins are powerful enough to handle doing things on multiple documents.  They provide access to the list of currently opened documents, so if you wanted to do something one every open document (or even pass in a set of files through the script parameters), automation plug-ins are the way to go.