imgflo / imgflo-server

HTTP image processing server based on imgflo
48 stars 7 forks source link

Support for processing GIF animations #28

Closed jonnor closed 6 years ago

jonnor commented 9 years ago

Currently GIF is not supported. Adding plain support for GIF is not hard, just additional encoding/decoding support in GEGL/noflo-canvas.

Animations however is a different story. Each input file. In the simple case one processes the whole file (all frames) and outputs this to a new .GIF including all the modified frames. However, one might want to:

bergie commented 9 years ago

See also https://imgur.com/blog/2014/10/09/introducing-gifv/

forresto commented 9 years ago

GIF quality is generally bad (or if good, takes a lot of care), so any processing will make it worse. Twitter's mp4 process totally murders quality. Over a certain file $ize optimization is understandable.

jonnor commented 9 years ago

GEGL can do processing by preserving the original GIF palette, which can be beneficial. Of course when doing a lot of filtering this is no longer possible (palette might not have required colors). If the image is not animated, might be better to output to JPG/PNG even if input is GIF.

jonnor commented 8 years ago

GEGL now can load GIF (or video) using ff-load, but saving animated GIF is not supported. Recommented way is to save out a video (using ff-save), then post-process it into a GIF with ffmpeg: http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html

jonnor commented 7 years ago

Considering to treat GIF inputs normally as video. Animations have time dimensions, and really, non-animated GIF should hopefully be extremely rare. Tricky thing is that in general consumers often don't know whether file is animated or not. And that right now, we actually don't either (no analysis of the input files before we hand them to GEGL).

bergie commented 7 years ago

The party creating the imgflo URL should know, though, since caliper provides animated: true.

jonnor commented 6 years ago

Out of scope