Skip to content

About

A local drawing studio that turns your brand artwork into pattern brushes. Upload a logo or brandbook, draw, export a PNG or a repeating tile. Runs locally. No API keys.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Pattern strokes

A local drawing studio that turns your brand artwork into patterned brushes. Upload a logo, images or brandbook; the app finds graphical elements, removes flat backgrounds and builds brushes from the actual source pixels and colors. Draw a composition, add a background image, or export a repeating pattern tile.

No API key or paid inference service. The package contains no brand templates, example brandbooks, generated backgrounds, demo drawings or uploaded user files. You bring your own material.

Screenshots

Brushes built from an uploaded brand kit (Accent brush)

Pattern strokes with the Accent brush drawing bottles and bears around a product photo

Another brand kit, same workflow

Pattern strokes with the Accent brush drawing logo, crocodile and tennis elements around a polo shirt

Orbit brush

Pattern strokes with the Orbit brush drawing logo and chip elements around a graphics card

Screenshots show brand files uploaded by the author for demonstration only. Brand names and marks that appear in them belong to their respective owners; this project is not affiliated with or endorsed by them.

Start

Install 64-bit Python 3.11–3.13 (3.11 recommended). Then download the repository as a ZIP (Code → Download ZIP), extract it and run:

python launch.py

On Windows, double-click start.bat. On macOS/Linux, use python3 launch.py or sh start.sh.

The launcher automatically:

  1. Creates an isolated .venv and installs the pinned Python dependencies.
  2. Downloads the pinned Florence-2 model (about 470 MB), verifies each file with SHA-256 and caches it in models/.
  3. Starts the local server and opens the studio in your browser.

First launch needs internet and may take several minutes. Allow several GB of free disk space for Python packages, model and caches. Later launches reuse verified files; inference runs on CPU and does not upload your documents to external services. Python itself must already be installed. A recent Chromium browser is recommended. Node.js is not needed to run the shipped app: browser libraries and the font are included.

Keep the terminal open. Press Ctrl+C to stop. The launcher chooses a free port starting at 8875. Useful options:

python launch.py --setup-only
python launch.py --no-browser --port 8890

If a download fails, check the connection and run the same command again. Successful downloads are reused; partially downloaded files are replaced. Delete .venv to rebuild the Python environment, or a damaged file in models/ to download that file again.

Use

  1. Upload brand files: choose your own logo, artwork or document. Wait for automatic extraction; no crop selection is required.
  2. Pick a brush and draw. Mix as you draw changes brushes between gestures and after two seconds of continued movement.
  3. Scroll to change brush size; Shift+scroll adjusts existing stroke width and texture scale. The −/+ buttons also change brush size.
  4. Add background places an image under your drawing; it is centered and cropped to cover the square canvas. Remove deletes only the background. Clear deletes drawing strokes.
  5. Download PNG exports a 1536×1536 composition. Fill previews the chosen repeated texture; without a background image, its PNG export is the complete repeating tile. With a background, export is the displayed composition.

Undo removes an entire gesture. Ctrl/Cmd+Z undoes; Ctrl/Cmd+Shift+Z redoes. Drawing, extracted artwork and background are stored in your browser on this computer. Changing the localhost port changes the browser storage origin. Large drawings can exceed browser storage; download PNG to retain the result.

File support and limits

  • PNG, JPEG, WebP, GIF, AVIF, BMP, SVG: browser-decodable raster rendering; SVG is rasterized rather than retained as editable vectors.
  • PDF: first 8 pages, rendered locally.
  • PSD: saved flattened composite required; editable layers are not reconstructed.
  • TIFF: first page.
  • DOCX/PPTX: embedded supported images, not full document layout. Export to PDF if needed.
  • Up to 8 uploaded files, 60 MB per file; automatic extraction analyzes the first 8 rendered source views. Individual analysis requests allow 16 MB / 4 megapixels and time out in the UI after 120 seconds.

Automatic extraction is experimental. Small, complex, overlapping or low-contrast artwork may be missed or incorrectly grouped. Caption-derived object hints and flat-matte removal do not provide general semantic segmentation. If no usable artwork is found, the app reports the failure rather than substituting a demo template. Transparent standalone artwork usually needs no model inference.

Develop

python launch.py --setup-only
.venv/Scripts/python -m unittest discover -s tests   # Windows
.venv/bin/python -m unittest discover -s tests       # macOS/Linux

Front-end files are plain HTML, CSS and Canvas JavaScript in studio/. All interface typography uses fixed letter-spacing: 0.04em.

To rebuild the bundled document reader, install Node.js 22.13+, then:

npm ci
npm run build

package-lock.json pins browser build dependencies. requirements.txt selects the CPU runtime; requirements-lock.txt pins the tested transitive dependency versions. The model repository revision and every file digest are pinned in model-manifest.json. The model uses the native Transformers implementation; no remote Python model code is executed.

Files:

  • launch.py: dependency installation, model download/integrity checks, launch.
  • server.py: local-only HTTP server and extraction API; only studio/ is served publicly.
  • brand_extractor.py: object detection, caption-assisted localization, flat-matte cleanup and deduplication.
  • studio/paint.js: brushes, canvas rendering, export and browser persistence.
  • studio/brand-paint.js: upload/extraction pipeline and palette.
  • studio/brand-reader.js: source for the prebuilt document reader bundle.

Notes

Keep .gitignore: .venv/, model weights, user uploads, outputs and node_modules/ must not be committed.

GitHub Pages alone cannot run the extraction backend. This package is a local application, not a public hosted service. Remote deployment needs a Python backend and a separate production deployment/security configuration; the included server intentionally binds only to localhost.

License and credits

MIT; preserve LICENSE and THIRD_PARTY_NOTICES.md. Inspired by Synchromy by Etienne Mineur. The separate local model is florence-community/Florence-2-base-ft, converted from Microsoft Florence-2, under MIT. Manrope is included under SIL OFL. Each dependency keeps its own license. Uploading a file does not change the rights to its artwork.

About

A local drawing studio that turns your brand artwork into pattern brushes. Upload a logo or brandbook, draw, export a PNG or a repeating tile. Runs locally. No API keys.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages