I was making some gifs of Mobius transformations in Matlab, and some strange patterns began to appear. I'm not sure if a deeper knowledge of the filetype/algorithm is needed to understand this phenomenon, but I thought that there could perhaps be a purely mathematical explanation. The image is obtained by coloring the complex plane like a checkerboard, and then inverting it by taking the reciprocal of the complex conjugate. Here is the math psuedocode for the image with a given zoom $k$:

$\mbox{checkerboard}:\mathbb C \to\{\mbox{black},\mbox{white}\}$

$\mbox{checkerboard}(z):=\begin{cases} \mbox{black} & \mbox{if }\lfloor\Im(z)\rfloor+\lfloor\Re(z)\rfloor\equiv 0\mod 2\\ \mbox{white} & \mbox{if }\lfloor\Im(z)\rfloor+\lfloor\Re(z)\rfloor\equiv 1\mod 2 \end{cases}$

$\mbox{image} = \{z\in\mathbb C:|\Re(z)|,|\Im(z)|\leq 1\}$

$\mbox{color}:\mbox{image}\to\{\mbox{black},\mbox{white}\}$

$\mbox{color}(z):=\mbox{checkerboard}(k/\overline{z})$

And here are the pictures for $k=1$, $k=50$, and $k=200$. The resolution of each picture is 1000x1000.

EDIT: More specifically, why does the Moiré pattern 'sync up' with the resolution of the picture at certain points? Can the Moiré pattern be predicted?

EDIT (Partial answer): I posted this question on image processing stack exchange, and I got a decent answer for why the pattern syncs up at certain points. I would, however, love a more detailed mathematical explanation of why the pattern seems to behave differently at different such points. Here is a gif I made illustrating the interesting stuff going on when you zoom in: https://media.giphy.com/media/3og0IwUINwEQAYoUDK/source.gif

`plot(sin(1:1000),'.')`

in Octave or MATLAB. $\endgroup$1more comment