Skip to content
TringyTrongyPublic

About

A digital paper-marbling tray: float ink, rake it, and pull vector prints into a book of specimens.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Ebru

A digital paper-marbling tray. Float ink on the bath, rake it with a stylus and comb, stir it into spirals, then pull a print. The sheet is laid on, lifted off by a corner, turned over and pasted into a book of numbered specimens.

Open Ebru →

Ebru: a marbled pattern on the tray, with tools on the left and the inks and catalogue of patterns on the right

Ebru is the Ottoman art of marbling paper: colours are sprinkled onto a bath of thickened water, combed into patterns, and lifted onto a sheet laid on the surface. This app recreates the craft and presents it as a 19th-century merchant's sample book of marbled papers.

What makes it different

The ink is never pixels. Every drop is a vector polygon, and every gesture moves the whole bath with an exact, closed-form transformation from the mathematics of marbling (Lu, Jaffer et al., Mathematical Marbling, 2012):

Gesture Transformation Property
Drop of radius r at C P' = C + (P − C) · √(1 + r² / ‖P − C‖²) Preserves area exactly
Stylus or comb tine moving by u P' = P + u · drag · e^(−d/λ), where d is the distance to the tine Shears the ink; it never tears
Stir about C rotate by a · e^(−(‖P − C‖/R)²) Preserves area and winds ink into spirals

Edges are subdivided as they stretch, so lines stay crisp at any size. A print saves as a PNG at three times the tray's resolution (3600 × 2400, or 2400 × 3000 from a phone held upright) or as a resolution-independent SVG at 600 × 400 mm (400 × 500 mm on a phone). The full method is in docs/how-it-works.md.

Features

  • Five tools: drop, sprinkle, stylus, comb and swirl, each with one slider in real millimetres (drop size, spread, reach, tine spacing or stir width).
  • Five ink sets with real pigment names: Ottoman (lapis, madder, orpiment…), Florentine, Coast, Ember and Suminagashi. Switching sets re-inks the whole bath.
  • A catalogue of eight classic patterns that perform themselves step by step, with the specimen label narrating each step.
  • Pull a print: the sheet is laid down, soaks up the ink, lifts by a corner and turns over. Prints are mirror images of the bath, as on real paper.
  • A specimen book: prints are numbered, labelled with how they were made, and the twelve most recent are kept in your browser between visits.
  • Undo, sound (off until you turn it on), keyboard shortcuts, light and dark themes that follow your system setting, and touch support.

The catalogue

The eight plates: Battal, Gel-git, Taraklı, Chevron, Bülbül yuvası, Lâle, Serpentine and Suminagashi

Plate Pattern How it is made
1 Battal (stone) The first colour is sprinkled until it covers the bath; each colour after it opens in cells.
2 Gel-git (back and forth) A stone ground raked with a stylus, down then up.
3 Taraklı (combed) Gel-git, then a fine comb drawn across the stripes.
4 Chevron Close gel-git, folded into points by wide passes across.
5 Bülbül yuvası (nightingale's nest) Gel-git, then a nest wound at each point of a grid.
6 Lâle (tulip) Rings dropped inside one another, pulled into petals, with stems and leaves.
7 Serpentine A stone ground raked with wavy stylus passes, down then up.
8 Suminagashi Ink and clear water touched to the bath in turn, then breathed across.

Using it

Do this To
Click the bath, or hold to let the drop keep spreading Drop ink
Drag Sprinkle, rake with the stylus, or pull the comb (its tines stay square to your first move)
Press, then circle around that point Stir with the swirl
Pick a plate in the catalogue Watch a classic pattern being made. Stop here keeps it as it is; Finish now completes it.
Pull print Lift the pattern onto paper and paste it into the book
Click a specimen View it, save it as PNG or SVG, or go back to the bath. Prints from an earlier visit save as a 960-pixel image.
Key Action
1 – 5 Drop, Sprinkle, Stylus, Comb, Swirl
Shift + 1 – 8 Play a plate from the catalogue
[ and ] Previous / next ink
Z or Ctrl/Cmd + Z Undo
N New bath
P Pull print
Esc Stop a plate, or close the specimen viewer

The sheet lifting off the bath by a corner, with the pattern soaking through Dark theme: the book's bottle-green cloth cover with gilt rules

A pulled specimen open in the viewer, with Save PNG, Save SVG and Back to the bath Ebru on a phone held upright, with a portrait tray

Run it locally

There is nothing to install. Clone the repository and open index.html in a modern browser:

git clone https://github.com/TringyTrongy/ebru.git

To make a single self-contained file you can share or open offline (it needs Node.js 18 or later):

node build.js

This writes dist/ebru.html, with every script inlined.

The typefaces load from Google Fonts. Offline, the page falls back to a system Bodoni or Didot (or Georgia) and to Helvetica or Arial.

Project structure

index.html          markup and all styles
js/marble.js        the geometry engine: shapes, transforms, subdivision and thinning
js/render.js        drawing the bath, prints, thumbnails and SVG export
js/recipes.js       ink sets, the catalogue of plates, and the performer that plays them
js/sound.js         Web Audio sounds for drops, raking and pulling
js/app.js           the book around the tray: tools, gestures, undo, pulling, the specimen rack
build.js            inlines everything into dist/ebru.html
tools/shoot.js      drives the page in headless Chrome for screenshots and checks
docs/               how it works, and the screenshots used here

The scripts are plain browser JavaScript with no framework, bundler or dependencies. The engine (js/marble.js) has no DOM code and also runs under Node.

Screenshots and checks

tools/shoot.js drives the page in headless Chrome over the DevTools protocol. It plays scripted scenarios and saves screenshots to screenshots/:

node tools/shoot.js all --scheme dark

The scenarios are rest, tools, pull and plates (all runs every one). Use --size 1280x720 to change the viewport, --mobile --size 390x844 to emulate a phone and --reduced-motion to test without animation. The script needs Node.js 22 or later, and Chrome. Set the CHROME environment variable if Chrome is not at its default Windows path.

Browser support

Ebru needs a current version of Chrome, Edge, Firefox or Safari. It uses Canvas 2D, Pointer Events, the Web Animations API, CSS container queries and Web Audio.

Credits

  • The transformations follow Shufang Lu, Aubrey Jaffer, Xiaogang Jin, Hanli Zhao and Xiaoyang Mao, "Mathematical Marbling", IEEE Computer Graphics and Applications 32(6), 2012.
  • Typefaces: Bodoni Moda and Archivo, both under the SIL Open Font License.
  • Pattern names come from the Turkish ebru tradition (battal, gel-git, taraklı, bülbül yuvası, lâle), from European marbling (chevron, serpentine), and from Japan (suminagashi).

License

MIT

About

A digital paper-marbling tray: float ink, rake it, and pull vector prints into a book of specimens.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages