Tech News
← Back to articles

Show HN: Reconstruct any image using primitive shapes, runs in-browser via WASM

read original related products more articles

A web app that reconstructs any image using primitive shapes; port of fogleman/primitive

English | Japanese

This is a web application that converts any image into one expressed solely through geometric shapes. It runs on WebAssembly, with all processing performed entirely on the device.

Original Processed

The algorithm attempts to reproduce the input image using only predefined shapes, minimizing the error between the input image and the image being drawn. This process is iterative, adding one shape at a time. The progress of shapes being added can be observed.

This is a WASM port and Web UI for the idea by fogleman: fogleman/primitive. The original primitive is a Go-based CLI tool and not easy to use, so I made it available from a browser. Please consider starring fogleman/primitive.

Usage

You can use it by accessing primitive-playground.taiseiue.jp. Generation usually takes tens of seconds to several minutes.

The configurable values are as follows:

Shapes The number of shapes to be generated. The default value is 100.

... continue reading