
So now the animation you lovingly crafted and optimized to be under a megabyte won’t surprise you by timing out or exploding in size and getting rejected. Perhaps the biggest thing is that it is highly unlikely that a resize to smaller dimensions will create a bigger file. The images are significantly smaller, too.

That meant that we were only 10x faster than our previous converter instead of being 12-15x faster. When reducing the size of a 2-color black-and-white GIF, it is nice to be able to use a few shades of gray for some of the pixels.Īs previously mentioned, we took a little speed hit by changing the resampling. The last change made here was to allow optional expansion of the palette for small-palette images. Despite my skepticism, this works amazingly well. This works for the vast majority of images while still avoiding the problem of having to choose which colors will be selected for the 512-color maximum palette (256 global and 256 frame-local colors). Scaling and resampling use 45-bit RGB colors (extra precision to allow a safe round-trip through gamma correction), but the results are fit to the original image’s color palette. Gifsicle takes a very different approach. This is slow and takes a ton of memory and can leave images looking muddy unless you sharpen them afterwards. Our old tool threw away all the palette information, resizing as if there were no color limits, and then took a second pass to try to create the optimum palette for the image. None are as fast as the “naïve” default method, but the results are simply much better.
Gifsicle reddit how to#
Eddie showed up with some brilliant ideas about how to handle resizing while maintaining performance and quality.Įddie added several resampling methods, including some hybrid modes. I would love to say there was a mutual “eureka” moment, but that would be a lie. We spent Friday the 13th basking in the warm, coal-fired glow of the GIF format and how to process it.īy the end of the day we had a handshake-deal for Tumblr to sponsor some feature development on gifsicle, and what we are releasing now is the result of that work. After we came to a mutual understanding of the problem, Eddie agreed to come visit us in New York. Late last year, we got in touch with Eddie. When it came time for Tumblr to reexamine how we manipulate GIFs, every engineer who looked at the problem inevitably came upon gifsicle, and every engineer eventually came to the same conclusion: the performance is stunning, but the quality just isn’t there. If you read between the lines of this post, sampling was obviously the issue. Scattered across the wacky animated set above is Eddie Kohler, professor of computer science at Harvard and the author of gifsicle since 1997. Eddie Kohler, a GIF creator’s best friend!
