Peek: Consider / propose as option / default to new lossy GIF encoder lossygif

Created on 13 Mar 2018  ·  6Comments  ·  Source: phw/peek

It's that time again! (see #212 🙂). @pornel of ImageOptim/PNGQuant/gifsky fame just released a first version of lossygif (website, github). Quoting the website,

This is an encoder (based on gifsicle) which implements lossy LZW compression. It can reduce animgif file sizes by 30%—50% at a cost of some dithering/noise.

Example: 3.3MB original vs 1.2MB lossy recompression

3.3MB original 1.2MB lossy recompression

Would be awesome for Peek to be able to directly use it. As an option and maybe even by default, as it seems to output good-quality but very compact GIFs.

enhancement

Most helpful comment

The settings can be reduced to:

[x] Fast conversion
[x] High quality
[x] Small file

Choose two.

All 6 comments

Lol :) But yes, definitely. My main concern right now is how to structure the settings. I want to make it easy for the user to choose between different options without requiring extensive research.

@phw cool; good point, UX/discoverability matters! Thanks for the continued work on Peek 🙂.

The settings can be reduced to:

[x] Fast conversion
[x] High quality
[x] Small file

Choose two.

have you tested if lossygif also brings big advantages for "common" screen captures? as i understood the article i've read, it was mainly for compressing movie snippets (as in the example above)...

It does help with screenshots a bit too, since anti-aliasing, icons and gradients can be lossily-compressed.
It will have an annoying tendency of making completely flat and white areas look dirty, because when it has a choice of few white pixels vs few white pixels & one light gray one, the latter seems like better compression.

@kornelski Thanks for the input.

I did some initial testing with a quick 15 seconds screen recording, converting a intermediary video file as generated by Peek with the options used by Peek. The video itself is a screen recording of this github issue tracker, so plain color areas, not too many colors (not the area where e.g. gifski shows its strength). The video frames are extracted to single files using ffmpeg and converted to gif using ffmpeg, gifski, gifsicle and giflossy. The file sizes:

  • Ffmpeg: 7.2 MB
  • gifski (quality 60): 10.0 MB (with a bit better colors at some points)

Now I can use gifsicle / giflossy as a postprocessor on those outputs to further optimize them:

For ffmpeg:

  • gifsicle (optimize 3): 6.7 MB, -7%
  • giflossy (optimize 3, lossy 50): 4.5 MB, -38%

For gifski:

  • gifsicle (optimize 3): 9.6 MB, -4%
  • giflossy (optimize 3, lossy 50): 9.6 MB, -4%

So using giflossy would really bring the file size down significantly when using ffmpeg. It ads some extra post processing time, but I haven't done any measurements on this. If only gifsicle is available it doesn't help that much. Also adding giflossy as a post processor to gifski does not help much, but that was kind of expected.

I tend to just use giflossy if available as a postprocessor by default, and maybe add an option to disable it.

Here is the smallest of the files I could generate:

ffmpeg-gifsicle-lossy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

msongz picture msongz  ·  7Comments

chteuchteu picture chteuchteu  ·  6Comments

jjnilton picture jjnilton  ·  7Comments

CasperHK picture CasperHK  ·  5Comments

leoherzog picture leoherzog  ·  7Comments