Description
I have a few example gifs that seem to really increase in filesize when run through libvips. This doesn't seem to be the case for all gifs, but i haven't been able to figure out why it's seemingly much worse for some files.
Given this example input gif (~897 KB):
vipsthumbnail
(using cgif) returns a 3.5MB image:
vipsthumbnail "example.gif[n=-1]" --size 200 -o example_vips_out.gif
Gifsicle returns a less nicer-looking image, but it's ~1MB:
gifsicle --resize-fit 200x_ -o example_gifsicle_out.gif example.gif
Here's another example I found online:
This is a 570KB file, and if I run it through vips to resize to 1400px wide:
vipsthumbnail "test.gif[n=-1]" --size 1400 -o test_vips_out.gif
du -h test_vips_out.gif
24M test_vips_out.gif
Using gifsicle:
gifsicle --resize-fit 1400x_ -o test_gifsicle_out.gif test.gif
du -h test_gifsicle_out.gif
344K test_gifsicle_out.gif
Again, Gifsicle's image is not as nice looking. But that filesize difference is quite a bit, especially because the source is only 570KB.
I'm running:
vips --vips-version
libvips 8.12.1-Wed Nov 24 15:41:04 UTC 2021
gifsicle --version
LCDF Gifsicle 1.93