Skip to content

cgifsave file size larger than expected for some gifs #2576

Closed
@jmreid

Description

@jmreid

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):
example

vipsthumbnail (using cgif) returns a 3.5MB image:
vipsthumbnail "example.gif[n=-1]" --size 200 -o example_vips_out.gif
example_vips_out

Gifsicle returns a less nicer-looking image, but it's ~1MB:
gifsicle --resize-fit 200x_ -o example_gifsicle_out.gif example.gif
example_gifsicle_out

Here's another example I found online:
test

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

@dloebl @MCLoebl Found you a couple examples! 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions