Complex Image Mapping
Published:
In this blog post I will be talking about a piece of software I made for my final project in my Senior year highschool art class.
We were given a very open prompt and where pretty much allowed to do anything we wanted. So I decided to create a project idea that I had been thinking would look cool for a while.
The project involves using complex valued functions to warp images in interesting ways.
How it works
We will start with a complex value function specified by the user f(z). And then for each pixel in a given image located at (x,y) we will interpret its location as a complex number x + yi. Then we run this location through f giving us the location/complex number f(x + yi) which will then be the final location we will move the initial pixel to.
After doing this with every pixel the image will be warped in a way according to the complex function given. From this different properties of the function can be seen in how it warps the image. Continuous functions will smoothly stretch and warp the image. where discontinuous functions will show sharp discontinuities in the output image.
Try it here
This is a live version that runs in your browser. Type any function of z, or pick a preset. The variable t counts seconds, so expressions with t animate. Switch the source to domain colouring, or to a photo (mine by default; click Photo again to upload your own).
One difference from the original: here each output pixel z is coloured by whatever sits at f(z) in the source. Pulling back like this means every pixel gets a colour, while pushing each source pixel forward, as the original program does, leaves gaps wherever f stretches the image.
Find the original
All the code, how to run it, and demos are on my github post
