GIF, as seemingly everyone on the internet knows, is an image format that has become synonymous with the fact that it supports animation (even though it wasn't originally intended to). it's extremely popular and in recent years has become popular among glitch artists as well.
i run a tumblr blog called glitchgifs, where i'm regularly asked some variation of the question "how do i make glitch gifs?" my usual answer is that there are three basic ways:
- glitch a still image several times, then animate it.
- glitch a video, then make gifs from that.
- glitch a gif file—the most difficult because the file will likely break and then you'll need to use a program like irfanview to retrieve the damaged frames.
most "glitch gifs" that you see online are made using methods 1-2. in fact, i suspect that the majority of people who ask how to make glitch gifs are really asking how to do the technique that's come to be known as datamoshing. there are lots of great glitch tutorials and resources out there for these methods, so i don't want to waste anyone's time reinventing the wheel. instead, i want to talk more about how the GIF format works, and how you can take advantage of some of its idiosyncrasies.
it's notable that the color table is usually stored in the gif file itself. that means that we can glitch it, if we're careful. just take a gif and change the data in the table (and only that data):
you have to be pretty precise to do this without breaking it—the global color table (when present) starts at byte 14
another classic feature of GIF is support for transparency, which is handled by defining one of the colors in the table as transparent. but this can go wrong: google+ used to have a glitch in its gif uploader that confused transparent pixels with solid black ones, and vice versa. this created bizarre ghosting artifacts, as it would just lay the frames on top of each other, with some bits invisible so you could see the frames beneath:
g+ has since been fixed but you can create similar effects using tools like klear.me:
if you're super handy with a hex editor, you can even play with transparency there by manipulating the graphic control extension block. when present, this block will be eight bytes long, with the first three bytes being 21 F9 04 and the eighth byte always being 00. if present at all, there will be one GCE block for each frame in the animation.
again: if it's used at all, there will be one such block at the beginning of each frame... meaning you could even use different settings for each frame! more detailed information here.
early computer graphic designers using limited color palettes often had to use tricks to create the illusion of color depth. GIF uses a trick called dithering—simulating colors using randomly- or algorithmically-produced patterns of dots. with dithering and a well-chosen color table, it's possible to create gifs with almost-photorealistic colors.
each individual dither is just one pixel. that can be awfully small on today's screens, so to really play with dithering, you may want to enlarge them, like in daniel temkin's dither studies. to enlarge an image and get that "big pixel" look that i love so much, the setting is usually called something like nearest neighbor or preserve edges/crisp edges. many web browsers now support this as well, which means you can load up a gif in a web app like my HTML5 image filter, crank up the size slider, and watch the pixels dance.
(ironically, this feature works beautifully in browsers like firefox, even though the actual CSS filters themselves don't work in that browser, whereas the filters work in chrome, but chrome doesn't currently support "crisp edge" resizing!)
when upsizing your pixels in this fashion, the usual advice is to always go in powers of 2—200%, 400%, 800%, 1600%, etc. this will ensure that you get the crispest edges possible. but hey, maybe you want your edges to be a little messy...
more fun with color tables
if it's possible to get almost-photolike colors in a gif with the right color table, then from a glitch artist's perspective, we might be more interested in going the other way—deliberately using the "wrong" color tables to accentuate the dithering. for example, the "bitcrushed" look used by artists like jonCates involves extremely small color tables: as small as 2-4 colors.
i've taken a different approach with my color tables series. a year or so ago i was using photoshop's "save for web" dialog, preparing to save an image, when something about the color table caught my eye. the colors, the composition of how they were arranged (sorted by luminance)... these were beautiful and i was compelled to save it and take a screenshot. this became glitch color table #1.
so i started collecting color tables and posting them on tumblr. i've collected and published a few dozen now, many of them derived from glitched or bent source images. but these color tables aren't just pretty pictures—they're also tools for creating other artworks. by deliberately applying a color table that has few colors in common with the source material, we can get some unusual effects, as the software is forced to choose the "best" of many bad options. glitch color table #1 has no green in it, so watch how it deals with grass:
of course, you don't have to start a color table collection. you can load color tables directly from another gif, or use a palette editor program to design or edit your own dream color table. and though you're welcome to download and use mine, there are probably bunches more color tables floating around online. want to use the color palette from the original nintendo NES or gameboy? get the color tables here!
i've been using this trick a lot lately, such as in my dither sunsets series and my latest video. i start out by shrinking the source image/video at the beginning, which allows me to enlarge it back later once the dithering has been added. then i try it out with different color tables, and when i find a result i like, i enlarge it again. i can even animate them by exporting several different versions with slightly different dither settings, and then stringing them together into a gif:
so there you have it: GIF is far more than just an export format for silent video loops. it is a unique format to be mastered, with its own world of artifacts waiting to be explored.¶