invasion of the giant one bit gifs, part 3

Continuing the conversation with Beau Sievers about "bit depth" and "sampling rate" in animated GIFs. I had asked: "What would sampling rate be in GIF terms?" and proposed "number of frames." (We're comparing imaging technology to music technology so the metaphors are going to be fuzzy at some point.*) Sievers reminds us that sampling is already part of GIF-making in these three tweets:

GIFs, bit depth and sampling rate —- spatial resolution is also sampling rate. Which is why smoothing is bad and zooming is powerful. @tommoody

Smoothing is a kind of destructive upsampling technique; it, uh, disrupts the integrity of the picture plane. @tommoody @clementgreenberg

Zooming pulls an image out of the sampling rate-/resolution-space of the desktop or browser window, smoothing re-absorbs it. @tommoody

Zooming here is used more broadly here than just "the movement of a zoom lens" and includes simple one-step GIF-enlargement, say, from tiny pixel size to huge, as Nullsleep was demonstrating. Some people have been using that for artistic effect - a "change in scale" a la Claes Oldenburg making a giant toilet or pencil eraser. You could redraw the image but most people use a sampling algorithm. The two main kinds are "bicubic" and "nearest neighbor" and it's with bicubic, the Photoshop default, that you get the "destructive upsampling" Sievers mentions, particularly noticeable when enlarging a GIF with hard edges (due to low bit depth). The algorithm literally adds information, light-to-dark gradients to smooth seams, which are not in the sampled GIF. (Destruction by addition of "polluting" data.)

This topic started with a GIF that was likely not resized (and therefore not sampled) but rather generated from scratch, using various parameters. It imitated shallow bit depth without having a reason, such as a pre-existing full color GIF that had been converted to black and white in order to save bandwidth. If that unique GIF (which we were arguing was mainly an exercise in style) were enlarged you would use "nearest neighbor" if you wanted to keep it looking all "1-bit."

I was using "number of frames" to refer to sampling not of space but of movement: a sample of a musical waveform takes a series of snapshots of the wave and in image motion capture you literally take stills of the action. You can reduce the sample rate by removing sample points and you can reduce a GIF by taking out frames: in both cases you end up with a smaller and more "instantaneous" file.

*Per Wikipedia, in computer graphics, bit depth is the "number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer." In digital audio, bit depth describes the "number of bits of information recorded for each sample" (basically everything except pitch, which is determined by the sampling rate). GIF-wise, by "frame rate" in the prior post on this topic I meant the playback rate, which has no effect on the size of the file. If the GIF was taken from a video of movement, the initial capture rate would of course impact the number of frames. GIFs themselves, however, do not record, they only compile or transcode other visual data.

Update: On the subject of GIF playback rate, please see Nullsleep's Animated GIF Minimum Frame Delay Browser Compatibility Study