Skip to content

Add examples/mandelbrot.pl demo#1

Open
karlglazebrook wants to merge 1 commit into
PDLPorters:masterfrom
karlglazebrook:add-mandelbrot-example
Open

Add examples/mandelbrot.pl demo#1
karlglazebrook wants to merge 1 commit into
PDLPorters:masterfrom
karlglazebrook:add-mandelbrot-example

Conversation

@karlglazebrook
Copy link
Copy Markdown
Member

Adds a small standalone demo script at examples/mandelbrot.pl showcasing the three main image-writing entry points of PDL::IO::GD:

  • write_true_png() — for a 24-bit RGB sunset gradient
  • write_png() with a custom 256-entry rainbow LUT — for an indexed-colour Mandelbrot set
  • The OO $image->write_Jpeg() interface — same Mandelbrot as JPEG

The Mandelbrot computation is fully vectorised in PDL (no per-pixel loops), making the script a small illustration of why someone might want PDL::IO::GD in the first place. Self-contained, no external data files, runs in a few seconds, produces three pretty images in the cwd.

Generated by Karl Glazebrook + Claude during PDL 2.104 / SciPDL v2.104 work — the JPEG output specifically tested SciPDL's new bundled libjpeg-turbo + libgd build path.

Self-contained demo showing the three main image-writing entry points:
  - write_true_png()  - 24-bit RGB sunset gradient
  - write_png()       - indexed PNG with a custom 256-entry rainbow LUT
                        (Mandelbrot set, 800x600)
  - $obj->write_Jpeg() - same Mandelbrot via the OO interface

The Mandelbrot computation itself is fully vectorised in PDL (no per-pixel
loops), making the demo a small advert for what PDL+PDL::IO::GD can do.
Runs in a few seconds with no external data files. Output goes to the cwd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant