kword: an image > ascii converter
I have been tooling around with typewriter “ASCII art” style image reproduction for some time, well, since I acquired my typewriter.
I found several problems with existing image to ASCII generators for my application (reproducing digital images on a typewriter):
- Character set too small (lack of color depth)
- Character set too large (slows typing and adds false textures if asymmetrical characters are used, adds error)
- No custom font (assumes all fonts have same character gradient)
- Character set not weighed at all (character brightnesses should be measured and colors indexed for correct gamma)
- No image adjustments in-converter (monochrome balance, contrast, crop)
- No realtime preview of settings (such as line spacing, font, and line length)
- No dithering option (losing color depth, especially in highlights)
Is a picture worth a 1000 word ASCII image? #
I decided to write an ASCII image generator of my own. It runs in the browser using <canvas>
and I call it kword.
Bottom left vs. center: kword optimization at work!
Features: #
- Custom character set
- Floyd-Steinberg dithering
- Measures and indexes character brightness per-font
- Realtime ASCII preview of all settings
- Font, size, print, dither, r, g, b, monochrome, line length, line height
To-do: #
- Curves
- Use font from image
- HDR (layered output)
- Subpixel rendering (each character split into regions for weighing, image upsampled *regions)
- Crop image
- Sliders for line length and line height