webmproject / WebPShop

Photoshop plug-in for opening and saving WebP images
https://developers.google.com/speed/webp/docs/webpshop
Apache License 2.0
1.49k stars 127 forks source link

How to WebP Animate Dialog Box using Photoshop Plugin #19

Closed ghost closed 4 years ago

ghost commented 4 years ago

The photoshop plugin seems to work well if I open a single PNG files, and then click SAVE/SAVE AS options. This usually opens WebP Dialog box to export the WEBP file from the PNG file. However, if I export animated GIF from After Effects into the photoshop, it opens as a sequence of layers within the layers panel of the photoshop. If I use "Export->Save for Web (legacy)" I can export the Optimized GIF from there. However, if I click on SAVE/SAVE AS option, I can only open simple WebP Dialog rather than WebP Animated Dialog to export the Animated WEBP Files. Can anybody help me with this?

y-guyon commented 4 years ago

To reproduce the issue directly in Photoshop, could you share here an animation (make sure it is public and copyright-free)? The exact taken steps and a screenshot of the displayed WebP window might help too, along with your OS/Photoshop/WebPShop versions.

It works for me to "Open" this animation and to "Save as" a new WebP; the Animated WebP Settings window is displayed. Could you try this image too, to make sure the plugin is fine? I would also suggest checking that the layer names are correctly formatted. WebPShop detects an animation if all frames match the name pattern "[Frame X] ([duration Y] ms)".

It would be better if WebPShop used the Photoshop Timeline data but I did not find how to access that from a plugin.

ghost commented 4 years ago

The layers in the Photoshop are not numbered as per the format you have shared. Besides, there are 195 total layers, and it would take a lot of time renaming them to the format mentioned. Can you suggest me an optimised way to rename layers with the format mentioned.

y-guyon commented 4 years ago

Photoshop loads GIF data (frame duration) into the Timeline but WebPShop cannot access it, so WebPShop tries to find it in layer names instead. I do not see an automatic way to bridge that gap.

However if your animation has a constant framerate (all layers have the same duration) you could use another plugin to rename every layer to "Layer (50 ms)" for example. There is also the good old copy+edit_layer_name+paste+tab+paste+tab+paste+... technique that might still be fast enough for your use case.

Unfortunately the Photoshop SDK API is limited, and so is also WebPShop. Last option would be to use another tool (Gimp, online converters, gif2webp etc.) to first convert your GIF to a lossless WebP animation, then to open that animation with Photoshop to be able to save it again through WebPShop. But then it would make more sense to only use that other tool and skip the Photoshop part.

ghost commented 4 years ago

I think its better to go with the third-party tools available online. It seems to be a more fast way to get things done. Thanks for the help.