Awhile back I did a quick vector illustration of a penguin. It was nothing much really but as far as penguins go I quite liked this one. Recently (as in, the last four months) I’ve been interested in databending. Have you ever had an image you’ve taken come out like it’s been through a shredder? That’s the effect that most databenders are after. In a way it’s like trying to reproduce an error. Once you’ve done it a few times you get to learn what effects different methods can produce but even then it’s very unpredictable. For a short tutorial on databending an image, take a look at the one I wrote for fizzPOP.
My curiosity lead me to see what can be done to databend an SVG file. In a similar way to a jpg or gif they’re just data but the difference is it’s human-readable. That is, someone could look at how an SVG is created and understand it. For example this code:
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?--> <!-- Created with Inkscape (http://www.inkscape.org/) -->
..Produces this circle:
With a bit of time you could easily read and write that code yourself.
So, with that in mind, using similar methods to this databending tutorial, can we apply a similar effect to the penguin? Like jpg’s etc the SVG has a header that, if modified, completely destroys the file. Using the above example the header is from lines 01 to 10. Open up your SVG in a text editor (for Windows I recommend Notepadd++, for Ubuntu/Linux Scite), cut those lines (a simple Ctrl+X will do) and then begin to edit your document!
You’ll notice that you have little flexibility with how you can modify it. With a jpg you can replace or delete any character and replace it with (almost) any other one. In an SVG if you change any of the letters then you render it useless. For example,
fill is a function that defines the colour of a shape. If you changed each instance of
fill to say
fail it would just simply break the file. Epic Fail. What you want to do is replace numbers with other numbers. There is a danger that replacing
#0909999909 could break the colour values but so far I have encountered no problems.
Once you have replaced a few numbers paste back in the header and then save it again. Open it back up and take a look at the results! Below are a few modifications I made. The process is described in the link.
You may find that each shape has become very warped or that the dimensions of your document have increased tenfold! That’s the beauty of the randomness that is databending.