README.md
Preview
Text · 5.2 KiBIridescent shapes
Sixteen smooth silhouettes, rendered as iridescent glass on a warm off-white field. Stars, cutouts, fruits and soft forms can be selected independently and overlapped in groups of three.
Open index.html for the labeled shape library, plain contours, four example compositions, a standalone heart and the flower composition. The browser shows saved previews. Generate new artwork with Python.
Reproduce
Use Python 3.10 or newer and the pinned dependencies:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-lock.txt
python renderer.py
python renderer.py --scale 2 --output renders/high-res.png
python gallery.py
python verify_shapes.pyThe default composition is 972 × 1202. The 2× export is 1944 × 2404. gallery.py produces the glass sampler, plain silhouette sampler and four overlapping studies plus a standalone heart. All images are generated from code and numerical lighting data. No reference image or image texture is included or needed.
Choose shapes
python renderer.py --list-shapes
python renderer.py --shapes seaweed coral bow --output renders/my-cutouts.png
python renderer.py --shapes crescent star sparkle --scale 2 --output renders/my-stars.png
python renderer.py --shapes apple strawberry lemon --composition a --output renders/my-fruit.pngSupply three shape names in back-to-front order. Choose between arrangements a and b; b is the default. Use --output to preserve the saved exports. Scale accepts values between 0.05 and 4. --no-calibration uses the base lighting fields without additional analytical light lobes.
The names are flower, star, sparkle, sun, coral, seaweed, butterfly, bow, pebble, bubbles, cloud, strawberry, lemon, apple, heart and crescent.
Smooth geometry
Fifteen silhouettes use periodic uniform cubic B-splines, converted exactly into cubic Bézier spans. Position, first derivative and second derivative agree at every join, including the closing seam. The heart uses six explicit Bézier spans: its broad lobes join tangentially, and its center notch and bottom tip deliberately stay pointed to match the requested silhouette. The reference image is not included or read by the renderer.
Simple forms use analytical profiles: ellipses and harmonic radial shapes. The cloud uses symmetric circular lobes with narrowly rounded joins. Branching cutouts, the butterfly, rounded bow and selected fruits use sparse control polygons. The spline approximates these controls instead of forcing the perimeter through every point. This removes local bumps caused by uneven interpolation nodes.
verify_shapes.py checks all sixteen paths for closure, finite coordinates, continuous first and second derivatives on the spline shapes, tangent continuity on the heart lobes, the two intended heart corners, nonzero sampled speed and sampled self-intersections. The plain renders/shape-outlines.png sheet makes visual inspection possible without shading.
Edge coverage is supersampled. The signed distance field has additional sampling, and surface normals are smoothed independently of the crisp coverage mask. This prevents raster steps from producing tiny bright nicks in the glass rim.
Customize
shapes.py defines the silhouettes. shape(name, center, radius, rotation=0) returns a closed cubic path. Position and radius use the 972 × 1202 design coordinate system. Rotation is in radians.
Edit positions, sizes and rotations in renderer.py's COMPOSITIONS or gallery.py's STUDIES. Entries draw from back to front. Each entry can contain a shape name; omitted names select the smooth flower.
Material settings include role (outer, middle or front), warmth, hue and opacity. These control the pearl, cyan/violet and orange/blue fields and their layering. Grain uses a fixed seed of 47. Repeated renders are deterministic within the pinned runtime; other library versions can produce numerical differences.
The lighting is analytical 2D illustration, not a physically traced glass simulation. lighting.json holds numerical coefficients for smooth color fields, not image data.
Files and outputs
shapes.py: continuous silhouette construction.geometry.py: Bézier curve sampling.renderer.py: material application, antialiasing, layering and export.material.py,lighting.py,lighting.json: procedural light and color fields.gallery.py: labeled samplers and four curated compositions.verify_shapes.py: contour continuity checks.renders/final.png,renders/high-res.png: current smooth flower composition.renders/shape-library.png,renders/shape-outlines.png: all sixteen current shapes.renders/shape-refinements.png: the new heart, butterfly, rounded bow and strawberry together.renders/shape-study-heart.png: larger standalone heart export.renders/shape-study-*.png: current cutout, celestial, fruit and soft-form studies.verification.json,MANIFEST.sha256: verification results and content hashes.
To rebuild one gallery asset, use python gallery.py --only sampler, --only outlines, --only refinements, or a study name (cutouts, celestial, orchard, soft-forms, heart). --output-dir selects the destination folder.