5 ms·
Show HN: Picunic – convert image to Unicode art using ML
I built Picunic, a web-based port of a terminal image viewer that converts images to Unicode art using a CNN.
*Demo:* https://mnur.me/picunic/ https://mnur.me/picunic/
*GitHub:* https://github.com/mohammed-nurulhoque/picunic https://github.com/mohammed-nurulhoque/picunic
*How it works:*
- Splits images into 8×16 pixel chunks (matching terminal cell aspect ratio)
- Runs each chunk through a CNN encoder to get a 64-dim embedding
- Finds the Unicode character with the most similar embedding (cosine similarity)
- The CNN was trained on ~2000 Unicode characters rendered in DejaVu Sans Mono
Everything runs client-side via WebAssembly - no server needed. Features include adjustable width, dithering for photos, and ASCII-only mode.
Built with Rust (compiled to WASM), ONNX Runtime Web, and vanilla JavaScript. The original terminal version is also available in the repo.
Currently works best for images with clear dark/light distinction. Would love feedback on the improving quality!
- ndgold 9mo agoError: no available backend found. ERR: [wasm] RangeError: Out of memory
- mntalateyya 9mo agoit worked on firefox on ubuntu and chrome on android. Not sure what the issue is. btw, it uses about 60MB of memory.
- reneberlin 9mo agocompare it to jp2a / ascii-image-converter In ascii they perform very well without ML, of course. You could set up a training based on that.
- mntalateyya 9mo agoThanks. Very helpful.
- mntalateyya 9mo agobtw I optimized it for edge detection, but it pretty much ignores luminosity. So it performs better at rendering text / line art, but worse at pictures without clear boundaries