News for hackers. Stuff that matters.

Show HN: Picunic – convert image to Unicode art using ML

https://mnur.me/picunic/

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!

( 5 comments | on HN )
Re:Show HN: Picunic – convert image to Unicode art using ML by ndgold on Thursday December 25, 2025 @07:40PM (#46388098)
Error: no available backend found. ERR: [wasm] RangeError: Out of memory
Re:Show HN: Picunic – convert image to Unicode art using ML by mntalateyya on Friday December 26, 2025 @06:30AM (#46391155)
it worked on firefox on ubuntu and chrome on android. Not sure what the issue is. btw, it uses about 60MB of memory.
Re:Show HN: Picunic – convert image to Unicode art using ML by reneberlin on Thursday December 25, 2025 @09:40PM (#46388730)
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.
Re:Show HN: Picunic – convert image to Unicode art using ML by mntalateyya on Friday December 26, 2025 @06:29AM (#46391152)
Thanks. Very helpful.
Re:Show HN: Picunic – convert image to Unicode art using ML by mntalateyya on Friday December 26, 2025 @06:46AM (#46391232)
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