Which is the best solution for Animated GIF image Compression in AEM 6.3



We have plenty of GIF images which author wants to upload we want to compress this image preferably dynamically that means on the fly instead of storing its rendition in DAM. The main catch here is that after the compression the animation of the GIF image should not be lost. Please note that I have tried below options here :

  1. The image transform servlet of ACS Commons ( this does change the color of GIF image but it looses the animation effect of the GIF Image, note we don't want the animation to be lost).
  2. Tried writing the custom servlet which based on different selectors writes image to the outputstreamLayer layer = ImageHelper.createLayer(res1); layer.write(image.getMimeType(), 255, response.getOutputStream());
  3. Extending DAM Update Asset with CreateWebEnabledImageProcess Workflow Process Step. This doesn't works in fact the renditions generated by OOTB DAM Asset workflows of 1280.1280 too looses the animation effect in GIF.

I have gone through this link, but couldn't find the right working solution so please don't mark this question as duplicate.

Lastly ImageMagick is better solution but this involves maintaining images of different renditions in DAM isntead of dynamic generation.

Any suggestions or thir party APIs which can be used are welcome.






ImageMagick app is to have pre sized images (image renditions) and load them based on need. Adobe also provide scene 7 however that needs additional license and it works pretty much ImageMagick with some additional features.

What problem do you see in loading & keeping multiple renditions?