One of the most recognized contemporary painters is Gerhard Richter; he basically has two distinct kind of paintings: “copies” of photographs and abstract paintings made in a procedural and somewhat mechanical way (have a look). Some years ago many of his paintings were hosted in the Strozzina museum in Florence; the very good guide challenged the crowd to understand the abstract paintings, whose impact on other artists was also shown in the very well-curated exhibition. I remember thinking that those paintings, by the “mechanical” way they were made, resembled the application of another mathematical procedure, called Fourier transform. For the non-technical crowd, I suggest reading a couple of articles to better understand what this transform is and most importantly how it affects everyday life: by a way of example, the mp3s that we listen to everyday are made through a series of Fourier transforms on the original sound wave, resulting in a much smaller file, which we can even stream on the fly over the internet. Its inverse is also used to interpret x-ray crystallography, which brought us the discovery of the DNA helical structure, above other things. To better understand how it works, you can have a look at this very nice article, or even play with it in your browser with this neat Flash (yuk) page.
After a couple of years I got involved in a discussion about Richter’s paintings and thought that would have been nice to see if it was possible to produce similar paintings using a somewhat automatic and mechanical procedure. Luckily, Fourier transforms are also used to produce JPEGs (the equivalent of mp3s for picture files), so bending this transform could have produced interesting results. The difference would have been that Richter uses is sensibility and experience to direct the process, while this other process would have been totally automatic, but also unpredictable to a certain extent.
After some research I’ve found a nice article that explains how ImageMagick, the popular Unix command-line tool for image manipulations, uses Fourier transforms and its inverse to manipulate pictures, showing for instance some practical examples on how to extract the phase and magnitude component from a picture and combining them back to the original file. What would have happened when thinkering a bit with this commands? I’ve done some experiments, and crafted a few bash scripts to make it a bit easier.
Reverse transform using only the image magnitude
The first experiment results are more similar to Richter paintings (not in terms of actual art of course!). Once the magnitude and phase components are extracted from a picture, much of the outlines of the image are stored in the phase component, while the colors are mainly found in the magnitude part (the fact that there’s no complete separation is a good thing, since it makes x-ray crystallography feasible). What happens when the inverse transformation is made using just the magnitude part? We should obtain a picture whose outlines are mostly gone, sprawled in an abstract way.
The results are even more surprising when a picture with regular patterns is used, demonstrating that part of the outlines are still retained somehow when doing the inverse transform.
Pretty abstract right? As you can see, using an image with a pattern generates more predictable results, which are still interesting. But we can do more…
Reverse transform with phase swap
Once we’ve extracted the magnitude and phase component we can separate them and do something stupid, like doing the reverse transform swapping the phase component of two images. Given the non complete separation of outlines and color, we can expect the resulting images to contain some of the tone and outline of the other. A bit like multiple expositions in photography, but with an abstract touch.
Again, using pictures with regular patterns results in interesting and slightly predictable results.
Sometimes, only one of the swaps looks interesting, usually due to the presence of patterns that somehow interact with each other.
These results look less abstract than the first trick, but look what happens when we use two pictures with clearly outlined patterns.
Reverse transform combining two magnitudes
Swapping two images is quite interesting, but as we saw with the third example, sometimes only one of the swaps is worth keeping. What we could do is tampering with the magnitude component prior to the reverse transform, for instance by multiplying together the magnitude components of two different pictures (the original and another one). For this experiment I had no idea what to expect.
It’s really nice how the original image is still “there”, but gets contaminated by the other one. Again, using patterns produces predictable but cool results.
The fact that the second picture is mostly black produces a weird blurry effect, a bit like tampering with fresh paint on a canvas.
That’s it for now! Any addition or nice abstract result you get using your pictures is more than welcome. Let’s see if we can fool someone in hosting a Fourier transforms exhibition somewhere!