Optimising GIFS from MB to KB

Use Gifsicle: Command-Line Animated GIFs — see website for install instructions.

Command

gifsicle -O3 simulator.gif > optimised.gif

Example results

input: 4.2MB
output -O: 105KB
output -O2: 84KB
output -O3: 79KB

Integration

I have set up a right click menu in macOS Finder that allows me to right click any GIF and optimise it.

You can also use ImageOptim or similar GUI wrappers for gifsicle.

14 Likes

How did you set up a right-click command for this?

I used ContextMenu I’ve been using that for years.

But there’s also the newer ServiceStation and another alternative fiScript.

hmm, I’m having some difficulty setting this up with ContextMenu.

image

langui.ContextMenu/Actions/optimize....cmaction/main.sh: line 1: gifsicle: command not found

I’m very unversed in bash, but running the same command from terminal worked like a charm. What am I doing wrong here?

no worries! here is what I use.

  • I have variables for the FILEname (minus .gif extension) and PARENT folder.
  • I call installed gifsicle so have to run out of sandbox.
  • O3 with careful is just to help with compatibility of resulting GIF
  • this will spit out anim.opt.gif next to your original anim.gif
FILE=`basename "$@" .gif`
PARENT=`dirname "$@"`
/usr/local/bin/gifsicle -O3 --careful "$@" > "$PARENT/$FILE.opt.gif"

Screen shot 2020-05-31 at 20.53.04

1 Like

Worked like a charm thank you!

There is also a nice (free) GUI app for Mac called ImageOptim that I enjoy using. Lots of great options!

1 Like