now listening
shared items
...more shared items
archives

11/01/2003 - 12/01/2003

12/01/2003 - 01/01/2004

01/01/2004 - 02/01/2004

02/01/2004 - 03/01/2004

03/01/2004 - 04/01/2004

04/01/2004 - 05/01/2004

05/01/2004 - 06/01/2004

06/01/2004 - 07/01/2004

07/01/2004 - 08/01/2004

08/01/2004 - 09/01/2004

09/01/2004 - 10/01/2004

10/01/2004 - 11/01/2004

11/01/2004 - 12/01/2004

12/01/2004 - 01/01/2005

01/01/2005 - 02/01/2005

02/01/2005 - 03/01/2005

03/01/2005 - 04/01/2005

04/01/2005 - 05/01/2005

05/01/2005 - 06/01/2005

06/01/2005 - 07/01/2005

07/01/2005 - 08/01/2005

08/01/2005 - 09/01/2005

09/01/2005 - 10/01/2005

10/01/2005 - 11/01/2005

11/01/2005 - 12/01/2005

12/01/2005 - 01/01/2006

01/01/2006 - 02/01/2006

02/01/2006 - 03/01/2006

03/01/2006 - 04/01/2006

04/01/2006 - 05/01/2006

05/01/2006 - 06/01/2006

06/01/2006 - 07/01/2006

07/01/2006 - 08/01/2006

08/01/2006 - 09/01/2006

09/01/2006 - 10/01/2006

10/01/2006 - 11/01/2006

11/01/2006 - 12/01/2006

12/01/2006 - 01/01/2007

01/01/2007 - 02/01/2007

02/01/2007 - 03/01/2007

03/01/2007 - 04/01/2007

04/01/2007 - 05/01/2007

05/01/2007 - 06/01/2007

06/01/2007 - 07/01/2007

07/01/2007 - 08/01/2007

08/01/2007 - 09/01/2007

09/01/2007 - 10/01/2007

10/01/2007 - 11/01/2007

11/01/2007 - 12/01/2007

12/01/2007 - 01/01/2008

01/01/2008 - 02/01/2008

02/01/2008 - 03/01/2008

03/01/2008 - 04/01/2008

04/01/2008 - 05/01/2008

05/01/2008 - 06/01/2008

06/01/2008 - 07/01/2008

07/01/2008 - 08/01/2008

08/01/2008 - 09/01/2008

09/01/2008 - 10/01/2008

10/01/2008 - 11/01/2008

11/01/2008 - 12/01/2008

12/01/2008 - 01/01/2009

01/01/2009 - 02/01/2009

02/01/2009 - 03/01/2009

03/01/2009 - 04/01/2009

04/01/2009 - 05/01/2009

05/01/2009 - 06/01/2009

06/01/2009 - 07/01/2009

07/01/2009 - 08/01/2009

08/01/2009 - 09/01/2009

09/01/2009 - 10/01/2009

10/01/2009 - 11/01/2009

11/01/2009 - 12/01/2009

12/01/2009 - 01/01/2010

01/01/2010 - 02/01/2010

02/01/2010 - 03/01/2010

03/01/2010 - 04/01/2010


Thursday, August 07, 2008 
databending and glitch art primer, part 1: the wordpad effect
welcome to my databending and glitch art primer! in part 1, we're going to talk about one of my favorite glitch art effects—the wordpad effect. i'm starting off with this effect because it's so easy that any windows user should be able to do it (note: i haven't tried it in vista), but it's complex enough under-the-hood that it allows me to discuss several important principles of glitch art. but first, let's define a few terms.

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:

DSCF1054

[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:

woods3

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:

girl and laptop

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:

save dialog

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".)

wordpad open dialog

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:

girlputer_bent_tif_interleave

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:

girlputer_bent_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:

tiff options

so here is my image, as a non-interleaved TIF, run through wordpad:

girlputer_bent_tif_noninterleave

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).

saving as raw

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.

photoshop raw save options

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:

photoshop raw open options

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:

girlputer bent raw

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.

Labels:



11 comments:
Very nice work on this primer, st!

Just for fun, I tried a quick experiment where I saved a master file (in this case, a "Barnsley" fractal) as 16-bit, 24-bit and 32-bit BMPs and "WordPadded" them all. The 16-bit BMP yielded no difference at all, and the 24-bit BMP (which I think is GIMP's default) had that cool grayscale funhouse effect with horizontal scanlines and occasional patches of "noise". The 32-bit BMP, though, turned out really nice.

I posted them here. ¶

Thanks for this - very helpful. I'm on Linux - and, just for reference - Open Office tries to be smart and places the BMP image in your document. AbiWord seems to attempt to open the file - but I wasn't patient enough to wait through it.

I ended up opening up the bitmap in vim and experimenting with global search/replace. I also played with ghex (gnome hex editor).

It was a fun tangent taken thanks to your post....

http://flickr.com/photos/thn/2768863243/ ¶

I've found that Wordpad does at least two things to a binary file; it replaces byte 07 (ascii: BEEP) with a space , and it replaces every lonely 0A or 0D (line feed and carriage return respectively) and also 0B (vertical tab) with the bytes "0A 0D". So the rate of glitching is probably dependent on how dark the picture is, since low bytes like these give dark pixels (i suppose). ¶

—posted by Anonymous pietjepuk666, at 11:13 AM, April 09, 2009  
This also explains why arratik got different results for different file types. I didn't test 32-bit BMP's, but I did test 24-bit, 8-bit, 4-bit and 1-bit BMP; I found tons of 07, 0A, 0B and 0D in the 24-bit as well as the 8-bit version; bending these resulted in quite nice bends in which the original picture (your cat photo) was not recognizable. The 4-bit version only got a nice color shift; the b/w became red and got some small glitches. This has to do with byte frequency; the 24-bit and 8-bit versions have lots of possibilities for every pixel, while the 4-bit and 1-bit versions had much less chance to incidentally get pixels that were 07, 0A, 0B or 0D. Also: large chunks of black or white (as in the cat photo) get zeros and "ΓΏ"s respectively, neither of which are bytes Wordpad will affect. ¶

—posted by Anonymous pietjepuk666, at 11:50 AM, April 09, 2009  
thank you so much for this, I have been searching the internet for a while for something like this and found nothing until now. ¶

—posted by Anonymous Boogles, at 7:24 PM, July 29, 2009  
Whenever I try the wordpad effect or opening and exporting an image as a .raw from audactiy, my pictures always come out in grayscale. This happens even if I simply export a picture as a .raw then open it in photoshop without doing anything to it. I've gotten some really cool effects which I think would look great with color. So far I've tried .raw, non-interleaved bitmaps and TIFF's and I'm using Photoshop CS3 version 10. Could it have something to do with the way that I'm saving or opening the pictures in photoshop? I have basically no knowledge of photoshop so I'm not too sure what it couold be.
Thanks. ¶

—posted by Anonymous Austin, at 12:43 AM, August 16, 2009  
austin: my guess would be that the problem is with audacity. others have reported problems with databending and audacity. ¶

It's not only Audacity though. It does the same with wordpad or even if I simply save and reopen a .raw in photoshop without doing anything to it. I'm assuming that it might have something to do with my lack of photoshop skillz. ¶

—posted by Anonymous Austin, at 12:20 AM, August 18, 2009  
I've made somehting similar but for jpeg's http://www.larsby.com/johan/?p=376 ¶

funny, I've opened a tif file in wordpad and then saved and... nothing happened :D now will try with messing actual data (btw found great way to remove photoshop name from file header :D) ¶

—posted by Anonymous Anonymous, at 1:52 PM, January 16, 2010  
anon: someone may have mentioned this above, but the amount of white or light-colored pixels has a major impact here. if your tif didn't bend, it was probably too dark. ¶


Powered by Blogger hosted by Sensory Research