Find pixel mapping matrix with minimum iterations
Number the pixels from $0$ to $n^2-1$. Then create $\lceil \log_2n^2\rceil$ many pictures. In the $i$-th picture all pixels are black, if the $i$-th bit in their number is $1$, white otherwise.

Note: If you have $2^k$ colors available, you can choose the color for each pixel based on $k$ successive bits of the number. This will reduce the number of images by a factor of $k$.