Skip to content

multilingualprogramming/Pixel2Plex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixel2Plex

Pixel2Plex turns raster images into mosaics built from the 20 two-uniform (demiregular) tessellations of the plane.

It extends the ideas from Pixel2Polygon: instead of regular or Archimedean tilings, this app renders richer edge-to-edge patterns whose vertices alternate between multiple configurations.

Live demo

https://multilingualprogramming.github.io/pixel2plex/

Features

  • 20 demiregular (2-uniform) tiling patterns
  • Drag-and-drop, click-to-upload, and PNG export
  • Adjustable tile size and optional outlines
  • Geometry computed in WebAssembly compiled from French Multilingual sources
  • Static frontend with GitHub Pages deployment

Canonical mapping

See docs/demiregular-mapping.md for the current mapping notes between the project's 20 methods and the canonical 20 demiregular tilings.

Project structure

Pixel2Plex/
|-- src/
|   |-- demiregulier_wasm.ml
|   `-- main.ml
|-- scripts/
|   `-- compile_wasm.ml
|-- public/
|   |-- index.html
|   |-- style.css
|   `-- app.js
|-- tests/
|   `-- smoke.js
`-- requirements-build.txt

Building the WASM

Install the build dependencies:

pip install -r requirements-build.txt

Compile the WebAssembly bundle:

python -m multilingualprogramming scripts/compile_wasm.ml

This generates:

  • public/demiregulier.wasm
  • public/demiregulier.wat

The build script also copies the Multilingual source files into public/ for inspection alongside the generated WASM output.

Running locally

Serve the public/ directory with any static file server that sends the application/wasm MIME type for .wasm files.

python -m http.server 8080 --directory public

Then open http://localhost:8080.

Smoke tests

Run the frontend and WASM smoke suite with:

node tests/smoke.js

The test suite validates:

  • the DOM contract used by the frontend
  • the render pipeline for all 20 methods
  • the exported WASM API and method codes
  • tile buffer readability for compiled WebAssembly output

CI and deployment

The repository includes GitHub Actions for:

  • smoke tests on pushes and pull requests
  • WebAssembly build verification
  • GitHub Pages deployment from main

About

Transform any image into demiregular tessellations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors