Max Colors and File Size

Two new features today, and you can see them both right here:


(Click to enlarge that.)

First, in the control panel, you’ll see a new slider below duration and fps. It’s Max Colors. Up to now, gifs were encoded with 256 colors. This was hard coded in one of the gif encoding modules that GLC uses. I didn’t write these, but did tweak them a bit to work with the system. They are mostly over my head, but I did figure out where this value was being set and went in there with a machete and hacked out a code trail to it and exposed that with a slider. The end result is that you can specify the maximum number of colors your final animated gif will have, anywhere from 2 to 256.

Note, sometimes those sliders can be difficult to get to land on an exact number. But once one is in focus, you can tweak it by single values using the cursor left and right keys on your keyboard.

Limiting the number of colors in the gif can have a big impact on the size of your output. Often at no visible loss of quality. Realize that changing this slider will not affect what you see in the Canvas panel AT ALL. Also, if you generate a gif, the slider won’t change that gif you’re looking at either. You’ll have to re-generate a new gif.

The other change, very much related to the first, is down at the bottom of the output panel. GLC will now estimate the gif size before you even save it. In my tests on Windows anyway, this estimation has actually been spot on. Different file systems may or may not make a difference, so I’ll leave the word “estimated” in there.

The combo of these two changes makes it possible to tweak your animation for size even more than you could with just fps and duration controls, and see the results before you even save the file. This can be vital if you’re trying to generate gifs for Tumblr, for example, which has a 2MB limit.

Leave a Reply