• Create Account

Banner advertising on our site currently available from just \$5!

### #ActualÁlvaro

Posted 06 February 2014 - 01:54 PM

As everyone suspected, it's just a Moiré pattern. Here's my attempt at producing it:

#include <cstdio>
#include <cmath>

int main() {
std::puts("# ImageMagick pixel enumeration: 800,800,255,srgb");

for (int j=0; j<800; ++j) {
double y = (400.0 - j) / 360.0;
for (int i=0; i<800; ++i) {
double x = (i - 400.0) / 360.0;
double z2 = 1.0 - x * x - y * y;
double distance = (z2 >= 0.0) ? std::sqrt(z2) : 0.0;
double color = std::fmod(1000.0*distance, 1.0);
int r = 256 * color;
int g = 256 * color;
int b = 256 * (1.0 - color);
r = r > 255 ? 255 : r < 0 ? 0 : r;
g = g > 255 ? 255 : g < 0 ? 0 : g;
b = b > 255 ? 255 : b < 0 ? 0 : b;
std::printf("%d,%d: (%d,%d,%d)  #%02X%02X%02X  srgb(%d,%d,%d)\n",
i, j,
r, g, b,
r, g, b,
r, g, b);
}
}
}



I compiled that code and then executed it, passing the output through | convert TXT:- output.png' (convert' is a command-line utility, part of ImageMagick). The output is this:

[EDIT: If you replace 1000.0 with something like 250.0, you'll get an image much closer to the original in this thread.]

### #1Álvaro

Posted 06 February 2014 - 01:51 PM

As everyone suspected, it's just a Moiré pattern. Here's my attempt at producing it:

#include <cstdio>
#include <cmath>

int main() {
std::puts("# ImageMagick pixel enumeration: 800,800,255,srgb");

for (int j=0; j<800; ++j) {
double y = (400.0 - j) / 360.0;
for (int i=0; i<800; ++i) {
double x = (i - 400.0) / 360.0;
double z2 = 1.0 - x * x - y * y;
double distance = (z2 >= 0.0) ? std::sqrt(z2) : 0.0;
double color = std::fmod(1000.0*distance, 1.0);
int r = 256 * color;
int g = 256 * color;
int b = 256 * (1.0 - color);
r = r > 255 ? 255 : r < 0 ? 0 : r;
g = g > 255 ? 255 : g < 0 ? 0 : g;
b = b > 255 ? 255 : b < 0 ? 0 : b;
std::printf("%d,%d: (%d,%d,%d)  #%02X%02X%02X  srgb(%d,%d,%d)\n",
i, j,
r, g, b,
r, g, b,
r, g, b);
}
}
}



I compiled that code and then executed it, passing the output through | convert TXT:- output.png' (convert' is a command-line utility, part of ImageMagick). The output is this:

PARTNERS