

I checked the metadata of the gifs above. That's a file without a ghosting effect: Īnd that's a resized file with a ghosting effect: I introduced some inconsistencies, because I firstly thought that parameters passed to cloudinary does not have any impact on output file regarding to ghosting effect, but I was wrong. (Alternatively, you might be able to achieve the overlay with Cloudinary! See the "Animated GIFs Overlayed Onto Videos" section here: ) If it doesn’t, I can only recommend finding a different library to handle animated GIFs, which respects frames' disposal settings. Would be to change this line of the method: I do not currently have an environment set up where I can try to replicate the bug or fiddle with the method, but the first thing that I would try, based on this documentation: I am not familiar enough with Core Animation to say so definitively, but I strongly suspect that the `getFramesAnimation` method here is assuming a value of "1" for all frames.
Gifsicle overlay gif code#
I am not sure what GifSicle is doing, but I think that Cloudinary's behavior here – preserving the disposal settings from the original gif passed to it – is correct, and the iOS code is definitely not respecting the disposal values present in the GIF. With these settings, every frame is supposed to be painted on a blank canvas. Note that disposal happens on a per frame basis.īoth of the files that you sent have every frame set to disposal value "3" here – restore to previous. As you said, this file displays fine in a browser so we will need to evaluate this particular use-case. I'm guessing you would want Cloudinary to respond with an "unoptimized" GIF (0)? Same as you produced with GIFSicle?īy default we are targeting browsers and are making sure files are as small as possible without losing quality. What was there prior to rendering the graphic. Restore the area overwritten by the graphic with Graphic must be restored to the background color.ģ - Restore to previous. The graphic is to be leftĢ - Restore to background color. Here is an excerpt from : iv) Disposal Method - Indicates the way in which the graphic is to The GIF format supports several disposal methods (as you might know).

Is the complaint then that Cloudinary does not produce a GIF that is correctly rendered in your iOS code? Are you seeing different "ghosting" effects when using the original URL vs. This url and this produce exactly the same file as far as I can see. cloudinary url: (that's an example, parameters doesn't have any impact) It does not have a ghosting effect right now (it had a little ghosting effect before, but I processed it via GIFSicle - I used except for `transparent` and `02` options) What's interesting, when I display one random frame from an array of frames as static image, it has a ghosting effect too. Passed frames parameter (images) is calculated via extracting gif data using Image I/O (CGImageSourceCreateImageAtIndex to create images and kCGImagePropertyGIFDictionary to get delays). What interests us the most is `getFramesAnimation` method.

I need to embed a gif inside a video, so I use a technique similar to: .
