Hacker News new | ask | show | jobs
Show HN: Picunic – convert image to Unicode art using ML (mnur.me)
1 points by mntalateyya 172 days ago
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/

*GitHub:* 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!

2 comments

Error: no available backend found. ERR: [wasm] RangeError: Out of memory
it worked on firefox on ubuntu and chrome on android. Not sure what the issue is. btw, it uses about 60MB of memory.
compare 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.
btw 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
Thanks. Very helpful.