# Transforming images

"Without a tagline since 2010"

### Image transformer

This page shows some transformed images. The transformation takes a rectangular image and changes it into polar coordinates.

Here are some "before" and "after" images of the transformer at work!

### The transformation

The transformation is actually a little more complicated than you might expect. Each pixel in the target image is mapped to a pixel from the source image according to:

$X = w \arctan\left(\frac{\sqrt{2}x-h}{\sqrt{2}y-h}\right)$ $Y = \frac{h-\sqrt{(\sqrt{2}x-h)^2+(\sqrt{2}y-h)^2}}{h}\arctan\left(\frac{\sqrt{2}x-h}{\sqrt{2}y-h}\right)$

where $$(X,Y)$$ is the coordinate in the source image, $$(x,y)$$ is the coordinate in the target image and $$w$$ and $$h$$ are the width and height of the source image. Here is what the transformation looks like when applied to rectangular coordinates:

make_gallery_table('Grid', 'grid') ;