Skip to content

Add dependency-free Mandelbrot HTML renderer example - #1681

Open
Copilot wants to merge 1 commit into
mainfrom
copilot/mandelbrot-html-renderer-2
Open

Add dependency-free Mandelbrot HTML renderer example#1681
Copilot wants to merge 1 commit into
mainfrom
copilot/mandelbrot-html-renderer-2

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds examples/mandelbrot/mandelbrot.py, a standalone Python script that computes the Mandelbrot set and writes it out as a single, self-contained HTML file (image embedded as a base64-encoded PNG). No third-party dependencies (Pillow/numpy) are required — it uses a small hand-rolled PNG encoder built on stdlib zlib.

Features

  • CLI flags for width/height, max iterations, view center, zoom, and output path
  • 4 color schemes: classic, fire, ocean, grayscale
  • Smooth (continuous) coloring to avoid banding
  • examples/mandelbrot/README.md with usage docs and a zoom example

Testing

  • Ran the script at several resolutions/zoom levels/color schemes and verified the embedded PNG decodes correctly and renders the expected fractal.
  • python3 -m py_compile passes.

Note: placed under a new top-level examples/ directory since this is a standalone utility unrelated to the bowtie JSON Schema test harness itself.

Adds examples/mandelbrot/mandelbrot.py, a standalone Python script that
computes the Mandelbrot set and writes a self-contained HTML file with
the image embedded as a base64 PNG (encoded via a small hand-rolled PNG
encoder built on stdlib zlib, so no Pillow/numpy dependency is needed).

Supports configurable width/height, max iterations, center/zoom, and
four color schemes (classic, fire, ocean, grayscale) via CLI flags.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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