Ian Bytchek
Gifox
Published in
4 min readApr 28, 2018

--

Not so long ago Gifox introduced support for global palette generation, which along with other recording and compression configuration gives plenty of control over resulting output. This article looks at how different Gifox configurations affect GIF quality, file size and processing time.

GIF can use local and global color palettes. Local palettes are unique to each frame and allow more colors per GIF at a cost of increased file size. Global palette limits entire GIF to 256 colors allowing to significantly bring down the file size and have consistent colors across the entire frame row.

Today’s specimen is an animation from iPhone X homepage with control configuration of 10 fps with 256 colors, global palette, and no dither.

Control GIF: 10 fps, all frames palette, 256 colors, no dither, 132 KB

All results were measured as a percentage difference against the control. To ensure results accuracy and eliminate human factor we used an automated benchmark with the same input and 5 passes per configuration from which the best result was taken.

Processing time was measured in simulated recording and conversion-only modes. Recording simulation makes 100 ms (1 s / 10 fps) delays before processing next frame to mimic real data feed from screen capturing, while processing-only mode simply crunches frames as fast as it can. Two modes help to illustrate how Gifox uses parallelized processing while still recording to finish same tasks faster under certain configurations. Further references to time results assume simulated recording mode.

The first thing that stands out is over 20 times increase in file size with 15% faster conversion time when using local vs. global palette – that is when palette gets created and stored for each frame individually. Frankly, after sharing this publicly I don’t even know why we have this option…

Next, we compare effects of reducing the color count. Expectably, the file size goes down, in our case by 16% and 28% when dropping from 256 to 128 and 64 colors, respectively. Processing time also goes down by a fraction.

Finally, we compare different dithering algorithms. They all result in a larger file size and slightly increased processing time, but often significantly improve final image quality, especially when using lower color count.

Dithering is used to create the illusion of “color depth” in images with a limited color palette — a technique also known as color quantization. In a dithered image, colors that are not available in the palette are approximated by a diffusion of colored pixels from within the available palette.

Recording configuration also has important parameters, such as downscaling and recording fps, which determine frame size and how many frames per second get captured. They play a big role in the resulting image file size and processing time – don’t neglect them. The content itself, obviously, plays a far bigger role, for example, processing low-color low-motion UI recording (kind of like above) will be faster and produce a smaller file size compared to a video from your last vacation.

Now lets have a look at and review actual produced GIFs, links to original files are provided below each image.

GIF: 10 fps, 256 colors, all frames palette, no dither, 132 KB – this is our control image, overall image quality is pretty good, but notice edgy window shadow and sharp colors in gradient inside the phone.
GIF: 10 fps, 256 colors, per frame palette, no dither, 2903 KB – image quality at first appears significantly better than control’s with smoother shadows and gradients, but wait a second… They are wobbling? 💩 Each frame has own palette resulting in same colors being encoded and presented differently in different frames.
GIF: 10 fps, 128 colors, all frames palette, no dither, 111 KB – halving the colors is not very noticeable yet, but if you look closer at the gradient inside the phone you’ll notice fewer grades.
GIF: 10 fps, 64 colors, all frames palette, no dither, 95 KB – reducing colors further becomes clearer inside the gradient, window shadow has also degraded and became edgier.
GIF: 10 fps, 256 colors, all frames palette, Bayer ×1 dither, 235 KB – the first thing you notice are tiny dots of color diffusion noise covering the entire image making shadows and gradients look perfect! 😚👌
GIF: 10 fps, 256 colors, all frames palette, Bayer ×3 dither, 175 KB – increased Bayer scale significantly reduced noise without degrading shadow and gradient quality. This is where dithering magic really shines! 🦄✨
GIF: 10 fps, 256 colors, all frames palette, Bayer ×5 dither, 141 KB – increasing Bayer scale further pretty much brings this back to the initial control GIF with same hard-graded shadows and gradients.
GIF: 10 fps, 256 colors, all frames palette, Frankie Sierra dither, 168 KB – shadow and gradient look very good, especially gradient, though the color transition from purple to blue looks rather noisy.
GIF: 10 fps, 256 colors, all frames palette, Frankie Sierra Lite dither, 359 KB – the first thing you’ll notice is a row of green dots in the Apple header… 😅 I really wish you haven’t – this is a small glitch inside Gifox. This doesn’t always happen and it’s also worth pointing out that gradients and shadows appear PERFECT!

So, what configuration to use when? Always and in all cases go with global (all frames) palette, unless there’s a good reason to do otherwise. For a good balance between image quality and file size we recommend sticking with 10–15 recording fps, 100–200 colors, and Bayer ×3 or Sierra/Lite dither. If you require best-looking image and size isn’t critical then use all 256 colors with Bayer ×2–3 or Sierra/Lite dither. Increasing recording fps will make the animation look smoother, but will increase the file size, in some cases significantly, so, use it with care. If size is the priority then stick with under 10 recording fps, 50–100 color limit, and no dither at all, or high scale Bayer.

GIFs are a great alternative between static images and full-sized videos that can help tell a story better than words and pictures. Gifox is a beautifully designed and masterfully crafted app that records your screen into animated GIFs.

Grab a free copy from our website if you haven’t already and if you decide to upgrade to a Pro version here’s a 32% coupon for first 64 users! ✌️

--

--