Assignment 1 – Image Rotation

The other day in a computer science class, I came across a funky-looking function that made my head spin trying to understand it. I wanted to try to emulate that feeling by taking an image of that formula and using Python’s image rotation function to rotate the image 41 degrees at a time. I chose 41 degrees because I wanted something that would not divide 360 degrees evenly. Pretty soon, we start to see the effects of resampling the image at every rotation. We also see the edges of the image rounding out as corners are clipped off at each rotation.

This video shows 30 iterations using the nearest pixel’s value for resampling. (The image didn’t seem to change much more after 30 iterations)

Out of curiosity, I also tried playing with the other two possibilities for resampling. This is what the image looked like after 100 iterations of bilinear resampling (linear interpolation in a 2×2 environment):

And this is what it looked like after 100 iterations of bicubic resampling (cubic spline interpolation in a 4×4 environment):

My code: