README.md

At d794128

d794128History

Preview

Text · 8.1 KiB

Iridescent shapes

A library of sixteen glass silhouettes includes stars, organic cutouts, fruit and soft forms, with four curated overlapping compositions. The original composition of three bubbly five-petal flowers remains included. Each flower has its own center, scale and rotation. Translucent color fields and luminous rims give the rounded petals an iridescent glass-like appearance. The artwork is a creative procedural composition, generated entirely from geometry, lighting functions and synthesized grain.

Open index.html directly in a browser to browse the shape library, four new compositions and the original flowers. The gallery displays saved previews; generation happens with the Python commands below. The viewer scales the image without cropping and keeps its controls outside the artwork. The high-resolution link opens the larger export.

Construction

renderer.py constructs each floral silhouette from analytical cubic Bézier curves. Five rounded petals alternate with deep, smooth valleys, producing inflated, soft-edged outlines. Independent centers, scales, rotations and petal radii let the three flowers overlap while keeping their individual shapes legible. There are no characters or faces.

The lighting method combines smooth colored fields, translucent layering, distance-based bright and dark rim bands, and fine deterministic grain. Cyan, blue, violet, pink and warm highlights create the impression of curved glass. Narrow chromatic contours and pearlescent regions carry the sense of depth through the overlapping petals. lighting.json stores compact numerical amplitudes for smooth analytical light lobes, not a raster texture. The renderer generates every output pixel from these functions; it does not load image textures or runtime source imagery.

This is an analytical 2D artwork. It evokes Fresnel reflection, refraction and glass curvature through color and contour treatment rather than physically accurate ray tracing. The overlaps are composed layers, and their apparent depth is a visual effect.

Reproduce

Use Python 3.10 or newer. Install the dependencies in an isolated environment:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-lock.txt

requirements-lock.txt pins the verified library versions. requirements.txt lists the supported version ranges for NumPy, SciPy and Pillow.

From this directory, generate the standard and larger exports:

python renderer.py
python renderer.py --scale 2 --output renders/high-res.png

The default output is renders/final.png at 972 × 1202 pixels. --scale 2 evaluates the artwork at 1944 × 2404 pixels. Use --output to choose another destination. Both exports contain the clean artwork. Open index.html after rendering; the viewer uses relative local paths and requires no server or internet connection.

The default arrangement is --composition b: a small pearly back flower, a large cyan/violet middle flower, and an orange/blue front flower. Choose the alternate triangular arrangement with --composition a. Keep the same composition option on both export commands. --no-calibration selects the base analytical color fields without their additional smooth lighting coefficients.

Files

FilePurpose
renderer.pyProcedural floral geometry, lighting and export CLI
geometry.pyClosed cubic Bézier petal paths and curve sampling
material.pyIridescent color fields and blending functions
lighting.py, lighting.jsonSmooth lighting functions and their numeric coefficients
requirements.txtSupported dependency versions
requirements-lock.txtPinned dependency versions
renders/final.pngClean artwork, 972 × 1202
renders/high-res.pngLarger clean artwork export, 1944 × 2404
index.htmlLocal browser viewer

The noise seed is fixed at 47 in renderer.py; there is no seed command-line option. Repeated renders with the same settings are reproducible within the same runtime. Library versions may cause small numerical differences. The high-resolution export evaluates the geometry and light fields at the larger resolution and synthesizes fresh deterministic grain for that size.

Customize the flowers

Edit a flower entry in COMPOSITIONS in renderer.py. Each arrangement contains exactly three entries, rendered in list order from back to front.

ParameterEffect
centerFlower position as (x, y) in the 972 × 1202 coordinate system
radiusOverall size in the same coordinate system
rotationRotation in radians
lengthsFive relative petal lengths; varies each petal independently
widthsFive relative petal widths; controls roundness and spread
valleysFive radial valley positions; smaller values deepen the gaps between petals
material.roleSpectral preset: outer for pearl/pink, middle for cyan/violet, or front for orange/blue
material.warmthVertical shift of the warm color field
material.hueSubtle tint variation between flowers
material.opacityLayer transmission and strength of overlap

Keep the lengths, widths and valleys sequences at five values to preserve the five-petal design. flower() in geometry.py also accepts five small angles offsets for petal asymmetry. Adjust the spectral fields in material.py and the rim treatment in renderer.py to change the glass finish. SEED in renderer.py controls the synthesized grain. The geometry and lighting remain procedural at every output size.

Design iterations

The included renders/flowers-*.png files preserve the design studies: two starting arrangements, then tighter nesting, distinct material roles, narrower glossy rims, partial color transmission and a final cooler top reflection. They contain only generated artwork. The published kit includes no source photographs, screenshots or comparison images.

The original flowers use twenty cubic Bézier segments each. Five independent rounded petal tips alternate with five smoothly joined concave valleys. The three presets remain editable rather than being flattened into the output PNGs.

Shape library

shapes.py adds sixteen reusable, closed cubic Bézier silhouettes: a rounded star, sparkle, sun, coral, seaweed, leaf, bean, pebble, bubble cluster, cloud, pear, lemon, apple, heart, crescent and the original flower. The cutouts use asymmetric branches and smooth concave transitions; the fruits use recognizable contours without faces or decorative details.

List the available names, then choose exactly three in back-to-front order:

python renderer.py --list-shapes
python renderer.py --shapes seaweed coral bean --output renders/my-cutouts.png
python renderer.py --shapes crescent star sparkle --scale 2 --output renders/my-stars-large.png

The selection uses the existing composition positions and independent material roles. --composition a offers a second arrangement. When --shapes is omitted, the original flower geometry and default output are unchanged. Use --output to preserve existing exports. Scale must be between 0.05 and 4.

Rebuild the labeled sampler and the four curated studies:

python gallery.py
python gallery.py --only sampler
python gallery.py --only orchard --output-dir /tmp/glass-studies

gallery.py stores the curated placements in STUDIES. Edit each shape's center, radius, rotation and material there to arrange new compositions. shape(name, center, radius, rotation=0) in shapes.py returns the same closed cubic-path representation used by geometry.curve_points. Rotations use radians. Silhouettes are resolution-independent; their edges and lighting are evaluated at the requested export scale.

New outputs: renders/shape-library.png (1440 × 1860), renders/shape-study-cutouts.png, renders/shape-study-celestial.png and renders/shape-study-orchard.png and renders/shape-study-soft-forms.png (each 972 × 1202). The sampler uses Pillow's bundled default font so it needs no system fonts or network access. The additional visual references are not included in this Kit and are not read by the generator.

Files