databending is, in essence, the artistic misuse of digital information. the term is inspired by the similar art of circuit bending; you could say that databending is like circuit bending with no circuits. the term is used most frequently in the context of electronic music (primarily glitch music).
the most common types of databending are:
- reinterpretation—converting a file from one medium to another (say, converting an executable file into an image file) or from one file format to a dissimilar format)
- sonification—the reinterpretation of non-audio data into audio data—probably the most common form of databending
- forced errors—forcing an application or piece of hardware to fail in the hopes that it will behave unexpectedly or the data will corrupt
- incorrect editing—editing a file using software/hardware intended for a different form of data; say, editing non-text files in a text editor
glitch art is visual art that involves or is caused by digital glitches or errors. (there's some debate over this, but for our discussions, we won't include art that simply "looks glitchy"; it has to involve real glitches.) not all glitch art is databent; sometimes it occurs naturally. hardware and software fail all the time, occasionally creating glitch art. but that depends on chance. let's talk about creating glitches on purpose—using databending techniques to create glitch art.
the wordpad effect:
the wordpad effect is a simple glitch effect i discovered a couple years back, with the help of my readers. here's how it works: you take a digital photo like this:
[note: all images in this primer are hosted on flickr. click the images to go to flickr, and to see larger versions.]
all you do is trick microsoft wordpad into opening the file (it's really easy). then, after the file is open, you click save. that's it! the file is now glitched:
pretty dramatic results, eh? is it really that simple? well, almost. if you're thinking there has to be a catch, you're right, but it's not a big one.
the catch is this: the wordpad effect generally only works on certain types of image files. specifically, it only tends to work on uncompressed bitmap files—the formats i use are BMP, TIF, and my favorite, photoshop RAW. if you try to use the wordpad effect on a compressed image file, such as a JPG or PNG file, the file will most likely break. this is because the wordpad effect is highly destructive—it often adds lots of glitches—and file compression tends to make files fragile—difficult to glitch without breaking. in compressed files, each bit is important, so even a tiny glitch in the wrong place can have a major effect. we'll use that to our advantage in part 3 when we glitch JPGs, but for now, let's avoid compressed files.
how to do it, step by step:
first, find an image file you want to glitch. make sure you know exactly how large it is, in pixels. my fiancée's camera takes pictures that are 2272x1704 pixels by default, so that's the size i'll be working with. your image is probably a different size. write down this info if you think you might forget it. i'm going to use this image:
make a copy of your image file. important: never, ever glitch your original images! always, always make a copy of the file and make sure you're glitching the copy and not the original. if you glitch your original and break it, your photo will be gone forever! so don't glitch your originals! ever! i cannot stress this enough.
make sure your image file is in one of these file formats: BMP, TIF, or photoshop RAW. if it's not, you can change the format using the "save as" command in pretty much any image editor:
open up microsoft wordpad. you can find it in the start menu under "applications". wordpad is a mini text editor that comes free with microsoft windows. its main function is to provide rich text formatting and to allow users who don't have microsoft word to open word files. if you have word, wordpad is pretty much useless... except for databending.
in wordpad, go to the file menu and click "open". at the bottom of the "open" dialog box is an option called "files of type". select "all documents (*.*)" for the file type. you may now choose your image file and open it.
(a common misconception of first-time databenders is thinking that they need to manually change the file extension of their files in order to open them in an "incorrect" application. generally, the way to do it [in windows] is to save the file normally, and then change the "files of type" setting in the target app to either "all documents" or "raw".)
wait for a moment while wordpad loads and formats the file. you have successfully convinced wordpad that your image file is a text file, and it will diligently try to reformat your file to fit the screen, changing straight quotes into "smart" or curly quotes, adding line breaks, and stuff like that. this formatting is what actually causes the glitches in your image, and the process may take a few seconds if the file is large. if the file is really big, it might even appear to hang, but just leave it alone and it should eventually finish (or on rare occasions, wordpad will crash and close, in which case you should try a different file).
after the file has fully loaded, go to the file menu and click "save".
go into the image editor of your choice and try to open your databent file. you may be prompted to enter the height and width for the image (which is why i told you to write it down earlier). my image looks like this:
you might get an error message—or several. click OK. eventually, you may find that your file won't open. it's possible that wordpad has broken the file—as i said, the wordpad effect is highly destructive, and sometimes it even breaks bitmaps. if so, try again using a different file format or a different image. on the other hand, it's also possible that your image editor is too sensitive about opening files with errors; try opening the file in microsoft paint, instead. if it won't open in paint, the file is probably fried.
the image above is a TIF file. let's try again with a BMP:
at this point, you may be looking at these two images (or your own, if following along at home) and thinking that they fall short compared to the example i showed earlier. that earlier example was full of bright, vibrant colors, while these are far more grey. what gives? the difference between that first example and these two is that the latter files are interleaved and the first example was not.
interleave vs non-interleave:
interleaving is a method of storing data in a non-contiguous manner. in this context it refers to the way that the file stores color information. your bitmap file most likely uses RGB color mode. this means that color values are stored as a combination of red, green, and blue. because the file is uncompressed, the file lists the color value for every pixel in the image. the interleaving refers to what order these pixel values are stored in.
if an image file is interleaved, the color values are stored in RGB order, one pixel at a time, like this: RGBRGBRGB... the bitmap data in the file (which comes after the header) will be basically just one long block of RGB values—for TIFs, they're stored from top-left down, and for BMPs, they're stored from bottom-right up. (BMPs are also stored in BGR order rather than RGB.) so, if you were to, say, insert two bytes of data near the beginning of the bitmap data, right before the R value, it would then "push" the other pixels over, and the R would become G, and so on. this way, you can easily create RGB color shifts in bitmaps, where reds become greens, greens become blues, and blues become reds. you may see a lot of these in your databent interleaved images.
on the other hand, if the file is not interleaved, the color information is saved as three color channels, one each for red, green, and blue. each channel is basically a grayscale image, and the bitmap data in the file stores the entire red channel, then the entire green channel, and finally the entire blue channel. when you run the wordpad effect on a non-interleaved file, each channel gets its own unique glitches, and the channels come out of alignment with each other, which can lead to some stunningly colorful bends.
so how do you create non-interleaved bitmaps? the BMP file format doesn't allow it; BMPs are always interleaved. in the TIF file format, interleave is optional, so you can choose whether your TIFs use interleaving (default is yes)... if your software supports it. a lot of image software doesn't support non-interleaved TIF files; i don't think any of the applications that come with windows do, nor does the popular (and free) GIMP editing suite. adobe photoshop does support non-interleaved TIFs:
so here is my image, as a non-interleaved TIF, run through wordpad:
then again, if you have adobe photoshop, you might be better off with the photoshop RAW format, which is possibly my favorite format for bending.
photoshop RAW format:
photoshop RAW format is a proprietary raw image format available in adobe photoshop. as far as i know, no other application can open these files, which have an .RAW file extension. so if you don't have photoshop, you can't use this format (though your image editor may have its own similar format; you never know).
what makes this format so great is its flexibility. not only can you choose whether or not to use interleaving, but setting the number of color channels is as easy as typing in a number. this allows you to work with grayscale files and CMYK color (though my experiments with CMYK have been underwhelming). and perhaps best of all, this format allows you to create files with zero headers that are impossible to break!
pretty much every file on your computer has a file header containing various data, such as what type of file it is, how large it is, and so on. most of the time, you need to carefully avoid bending the file header, because corrupting the header is the easiest way to break the file (with rare exceptions). photoshop RAW format allows us to avoid dealing with headers at all, simply by typing 0 into the header box. if you have a RAW file with no header, you can do just about anything you want to it—bend it in any way you can imagine—and it will still open.
i've now resaved my source image as a non-interleaved raw file with no headers. let's see what happens when i run it through wordpad and then try to reopen it in photoshop:
since we saved the file with no headers, photoshop has no way of knowing anything about this image. sometimes it is able to guess the size settings based on how large the file is, but most likely it will guess wrong. so when using this format, it's essential that you make a note of your image's exact pixel dimensions before bending it. in this case, as i said earlier, the image is 2272x1704 pixels, the file is not interleaved, and the number of color channels is 3 (for RGB). here's what the image looks like after running it through wordpad:
looks a lot like the non-interleaved TIF, doesn't it? the two formats are pretty similar, so aesthetically you won't notice a whole lot of difference between bent RAW files and bent TIF files that use the same settings. the biggest difference is that you can break TIF files by corrupting the header.
so that's the wordpad effect. you might note that the images in the tutorial are far more heavily glitched than the example at the top of the post. how heavy the glitching gets depends on your source image. sometimes, you'll even get images that don't bend at all! the pattern behind this is a mystery... let me know if you crack it.
note also that after you've run an image file through wordpad once, running it through a second time has no effect. that's because wordpad has already reformatted the file to its liking. if you want to use the effect on the same image multiple times, you'll need to alter the data somehow in between passes, for example by saving the image to a new file. another interesting variant is to flip the databent image horizontally, and then run the flipped image through wordpad—i call this reverse wordpad.
that's it for part 1 of this primer. if you're on windows, you should now know enough to apply the wordpad effect to all your images. if you're not on windows, the information should still come in handy for glitching bitmap files. and even if you're already a databender, hopefully you've learned something.
in part 2, i'll discuss sonification and making music out of the files on your hard drive. then in part 3, i'll come back to glitch art and talk about bending JPG files. ¶