15 July 2012

Generating the Thorn fractal in binary PGM format

While looking to test a Burg recursion implementation I'd written, I stumbled across some AR(p) test cases by Paul Bourke.  I emailed him to ask a question and, while browsing for his address, I stumbled across his material on the Thorn Fractal.  His (9.984, 7.55) image really struck me so I downloaded Paul's sample code.  Alas, it produced output in some "raw" image format that I couldn't coax ImageMagick or The GIMP into reading.  After digging around a bit, I decided to roll my own code to dump the output in binary PGM so that nearly any tool can postprocess the data.

Tada.  A grayscale version of (9.984, 7.55) created at 10000x10000, cropped, and downsampled to 1600x900 suitable for background use:

While most of the code was a one-off, I could see the PGM bits being useful again.  Feedback from anyone who knows 16-bit grayscale details well much appreciated the Thorn fractal needs nothing like 16-bits of information.  Incidentally, one could save a factor of two on the memory by using uint8_t instead of uint16_t.

No comments:

Subscribe Subscribe to The Return of Agent Zlerich