First, make a 8192×8192 image. I am using
PNG++.
>png::image<png::rgb_pixel> image(8192, 8192);
For each pixel, do this stuff:
Put the product of the x and y coordinates to the power of a small number (I used 4, 11, and 13). Put this value in a 32-bit integer. Do not worry about overflowing.
>uint_fast32_t color = x*x*x*x * y*y*y*y
Truncate the first half.
>uint_fast16_t color16 = color & 0x0000FFFF;
Treat this 16-bit integer as RGB565 pixel data, and convert it to RGB888 lazily (inaccurate algorithm).
>uint_fast8_t r5 = (color16 & 0b1111100000000000) >> 11;
>uint_fast8_t g6 = (color16 & 0b0000011111100000) >> 5;
>uint_fast8_t b5 = color16 & 0b0000000000011111;
>uint_fast8_t r = r5 * 8;
>uint_fast8_t g = g6 * 4;
>uint_fast8_t b = b5 * 8;
Then set the pixel to the RGB values you have.
>image.set_pixel(x, y, png::rgb_pixel(r, g, b));
When the image is saved, use a crappy scaling algorithm to scale it down to 2047×2047. Finally, shift the pixel data with wrapping enabled to center it properly.