Skip to main content
November 20, 2014
Question

Creating animated GIF using Photoshop Scripting

  • November 20, 2014
  • 1 reply
  • 3063 views

Hi,

I am trying to mimic the action "Save for Web & Devices" of a PSD file, having 4 frames in an animation, into an animated GIF file.

I was suggested to use "ScriptingListener", but I did the copy/paste of the code, it did not work.

Is there a way to code a script, by using classes/functions to achieve this result ?

Thank you in advance.

Jean-Louis

This topic has been closed for replies.

1 reply

matias.kiviniemi
Legend
November 20, 2014

You can create scripts using Javascript (and a couple of other choices) that has access to most features. So you could open a bunch of PNGs and copy them as layers to your PSD in the right order. But saving an animated gif in Photoshop required you to create and setup the timeline or the the animation option is not available. And timeline is something you can't access in Javascript so I would guess it's not possible in Javascript.

Personally I'd try to find some tool that can automatically convert a layered PSD file to animated gif and then make a script that compiles the layered PSD in the way you want.

November 20, 2014

Thank you, Matias !

So we can not access to the timeline / animation option in JavaScript,
the only way is to prepare all of them as layers and in correct order,
thus we can compile them all into animated GIF through script.

Is that correct ?

matias.kiviniemi
Legend
November 20, 2014

Yes that's my understanding for Javascript, with clarification that with "compile them all into animated GIF through script" using some external program (e.g. check out ImageMagick). Whether that is an OK solution depends on what you are trying to do (just for own internal use or distribution).

For the Javascript docs see http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref.pdf