DigitalArt.jl
The Julia package behind Hilbert & Turner — mathematics made into pictures, worked through the books of Farris, Bosch, and Dürer.
Where the command-line tools are for producing a finished image in under a second, this package is for exploration: every parameter is reachable, and the Pluto notebooks put the important ones on live sliders.
Installation
The package is not registered. From a clone of the repository:
using Pkg
Pkg.activate("DigitalArt/Julia")
Pkg.instantiate()
using DigitalArtEverything is re-exported from the top level, so using DigitalArt brings the whole surface into scope regardless of which project a function belongs to.
Quick start
Build a curve from Fourier terms and draw 128 rotationally symmetric copies:
using DigitalArt
cs = [1.0+0im, 0.5+0im, 0+im/3]
fs = [1.0, 6.0, -14.0]
func = t -> μg(t; cs=cs, fs=fs)
t = range(0, 2π, 1000)
fig, hist = drawZθfunc4b(func, t, chinese_red, mycolor, cfs3; n=128)
save("artwork.png", fig)Layout
Shared utilities live directly in src/; code specific to one project lives in a subdirectory named for it.
| Module | Project | Contents |
|---|---|---|
Curves | shared | Curve definitions, arc length, curvature |
Fourier | Creating Symmetry | μg (general curve), fkm (selective Fourier sum) |
Symmetry | Creating Symmetry | drawfunc, drawZθfunc4b |
SymmetryColors | Creating Symmetry | HSLA color generators and state machine |
TextLayout | Text Art | Text-along-curve layout: layout_text, PlacedGlyph |
TextRender | Text Art | Drawing placed glyphs: render_glyphs, save_render |
TruchetTiles | Opt Art | Tile geometry: TruchetTile, truchet_grid, white_area |
TruchetColor | Opt Art | Color: ChannelTile, truchet_color_grid |
TruchetImage | Opt Art | Images to tile grids: truchet_from_image |
Tone | Opt Art | Image to ink density: density_field, load_density |
Stipple | Opt Art | Initial point placement: initial_points |
MacQueen | Opt Art | The relaxation: relax!, learning_rate |
TourSolve | Opt Art | Near-optimal TSP: optimize_tour, greedy_tour |
TourCrossings | Opt Art | The Jordan guarantee: remove_crossings! |
TourSmooth | Opt Art | Catmull–Rom smoothing: smooth_tours |
Curves sits in src/ rather than under a project because both Creating Symmetry and Text Art build on it. A module belongs in src/ only once a second project needs it; until then it stays with the project that introduced it.
The API Reference covers all 29 modules.
Guides
Four hand-written guides cover the parts where knowing the function signature is not enough:
- Fourier Curves — how
cs,fs,k,m,M, andaschange what you see - Color System — color families, the
mycolorstate machine, and designingcfsarrays - Symmetry Rendering —
drawZθfunc4b, thehistreturn value, how curve shape and rotation count interact - Text on Curves — the layout/render split, real FreeType metrics, auto-fit
Notebooks
DigitalArt/Julia/notebooks/ holds one Pluto notebook per module (*.pl.jl), each demonstrating the key functions with interactive @bind controls. Launch with:
using Pluto; Pluto.run()The Rust companion
The Opt Art work has a Rust port — two command-line binaries, roughly 30–40× faster, golden-tested against fixtures generated by this package. It is a companion rather than a replacement: this code stays the substrate for the notebooks.
See the command-line documentation and its fidelity notes, which record exactly what matches between the two implementations.