ASCII Art Generator: Raster-to-Text Character Luminance Mapping
Convert photographic images, logos, and typographic text into retro ASCII text art using character density ramps and luminance quantization.
Luminance Quantization & Character Density Ramps
Image-to-ASCII generation works by mapping the perceived brightness of each pixel (or pixel block) onto a character ramp sorted from lowest visual density to highest:
Density Ramp: " .:-=+*#%@"
The algorithm calculates perceptual luminance for each downsampled pixel block: L = 0.299 × R + 0.587 × G + 0.114 × B. The normalized brightness (0.0 to 1.0) directly indexes the corresponding character glyph in the ramp, rendering shadows as dense glyphs like # or @ and highlights as spaces or dots.
Aspect Ratio Correction for Monospaced Fonts
In typical monospaced fonts (such as Courier, Consolas, or JetBrains Mono), character cells are approximately twice as tall as they are wide (an aspect ratio of roughly 1:2). Without vertical compensation, converted images appear stretched vertically.
Our generator samples vertical pixels at double the horizontal rate to preserve accurate physical proportions in monospaced terminal windows and text editors.
Pro Tip: Practical Application
For high-contrast terminal outputs or README markdown banners, use images with bold silhouettes and clean backgrounds to produce recognizable ASCII shapes.