ASCII Art Generator: Turn Photos and Logos Into Text Art

An ASCII art generator answers a simple question: what does this picture look like when every cell of a grid is replaced by a character whose ink density matches the brightness of that cell? Dark areas become @ and #, midtones turn to +, = and -, highlights fade into dots and spaces. The result is plain text that keeps the shape of the original well enough to recognize a face, a logo or a landscape.

This ASCII art generator runs entirely in the browser. You drop an image, the script samples it on a canvas, maps each sample to a character from the selected ramp, and shows the text art live. The controls cover width, character shape, ramps, tone, dithering, color and five export formats. The sections below explain what each control actually does to the output and how to get a clean result on the first try.

How Pixels Become Characters

The conversion is a small pipeline, and every step is deterministic. The image is drawn onto a canvas whose size equals the character grid: columns wide, and as many rows as needed to keep the picture's proportions. A 1600×900 photo at 100 columns produces 28 rows, because 100 × (900/1600) × 0.5 = 28.1. Each canvas pixel is one character cell.

Next, the canvas pixels are converted to luminance. This generator offers the two standard weight sets. Rec. 601, the older NTSC formula, uses L = 0.299R + 0.587G + 0.114B. Rec. 709 uses L = 0.2126R + 0.7152G + 0.0722B and matches modern displays more closely, so reds look darker and greens brighter than under 601. Neither is wrong; the toggle exists because a portrait often reads better with one model and a screenshot with the other.

The luminance value, after optional tone processing, picks an index into the character ramp. A ten-level ramp maps 0–25 to the densest glyph, 26–51 to the next, and so on. The result is a special case of vector quantization: hundreds of thousands of pixels collapse into a few dozen symbols, and the eye reconstructs the gradient from their density. That is also why the output has hard limits. Fine detail below the size of one cell cannot survive, so small text, thin strokes and distant faces turn into noise. Cropping the subject before conversion usually does more for quality than any slider.

Because the grid is built from characters and not pixels, the work stays small. A 100-column render touches about 2,800 cells, which is why the live preview can redraw after every change: the tool waits 200 ms after the last input and converts again.

Width and Character Shape

Width is the main quality dial. The generator accepts 20 to 400 columns. At 100 columns a typical 16:9 photo yields 28 rows and around 2,800 characters, which fits in a chat message or a code comment. At 400 columns the same photo gives 112 rows and 44,800 characters, enough for a poster but far too much for a README.

The second dial is character aspect, set between 0.40 and 0.70 and defaulting to 0.50. It compensates for the shape of a text cell. In a monospace font the glyph advance is roughly 0.6 em while the line height is usually 1.2 em, so a cell is about twice as tall as it is wide. If the converter ignored that, every picture would come out stretched vertically. Multiplying the row count by 0.5 cancels the distortion in most editors.

The setting matters when the destination differs from the default. Terminals with tight line spacing and code blocks with line-height: 1 need a lower value, around 0.42, or the art looks squashed. Chat apps and blog templates with generous leading need 0.55 to 0.60. A quick test: convert a circle. If it reads as an oval, adjust the aspect by 0.05 and convert again.

Width and aspect interact with payload size. A 200-column, 40-row image is 8,000 characters, roughly 8 KB of text. Doubling the width quadruples the character count, since rows scale too. For documents that wrap at 72 or 80 columns, staying at 60 to 72 characters avoids line-wrap damage, which is total rather than graceful: one wrapped line shifts every row below it.

Character Ramps and Their Levels

The ramp decides the style as much as the resolution does. Printable ASCII has 95 characters (codes 32 to 126), and the classic ramps borrow a small ordered subset of them. This generator ships 12 ramps plus a custom field.

RampLevelsBest for
Standard10 (@%#*+=-:. )quick previews, small sizes
Detailed70photographs at 120+ columns
Block shading5 (█▓▒░ )logos, flat shapes, high contrast
Binary2 (1 0)stylized, poster-like output
Minimal4tiny banners and favicons
Letters12a softer, typographic look
Technical10diagrams, blueprints
Numbers10data-like visuals
Hex16programmer aesthetics
Katakana10the classic Japanese BBS look
Greek10an academic variant
Arrows8motion and direction

The 70-level ramp is the one Paul Bourke published in 1997 and most converters still copy. It carries the most gradation plain ASCII can offer, but it also turns to mush below about 9 px of font size, because half its levels differ by a single stroke. The ten-level standard ramp is coarser but survives small sizes and low-contrast sources far better.

Order inside the ramp is not cosmetic. A ramp should run from the most ink to the least, and the levels should be spaced by measured ink coverage rather than typed in a guessed order. Otherwise midtones cluster on two or three characters and the picture looks banded. The custom field accepts any string of at least two characters, so a logo can be rendered with the letters of a brand name, and the Braille preset does exactly that with a custom Unicode Braille ramp.

Reversing the ramp or inverting brightness handles light-on-dark destinations. They are not the same operation: reversing swaps dark and light glyphs, while inverting flips the luminance before the ramp sees it, which also changes the tone curve. On a dark theme, reverse the ramp; when the source itself is a negative, invert.

Dithering: Floyd-Steinberg and Bayer

Dithering trades spatial resolution for tonal resolution. Instead of picking one glyph per cell, the algorithm mixes neighboring glyph levels so the eye averages them into a shade the ramp does not contain. Two families are available here.

Floyd-Steinberg, published in 1976, is an error-diffusion method. Each cell is quantized to the nearest ramp level, and the difference between the original luminance and the chosen level is pushed onto unprocessed neighbors: 7/16 to the right, 3/16 to the lower left, 5/16 directly below, 1/16 to the lower right. The pattern looks organic and grainy, close to a Game Boy Camera print. It works well on portraits and gradients, and it can smear fine edges because the error travels across them.

Bayer dithering uses a fixed threshold matrix, usually 4×4 or 8×8, compared against the pixel value. It produces a regular cross-hatch that is stable from frame to frame and keeps edges crisp. For flat graphics, logos and anything that will be scaled down, ordered dithering is the safer choice. For photographs, Floyd-Steinberg reads better at the same width.

The default is no dithering, which suits high-contrast sources: logos, line art, screenshots, block ramps. Turning dithering on for a photo with a smooth sky is usually the single biggest visual improvement, at some cost in sharpness. One caveat: dithering fights with posterization. If the tone card posterizes to 4 or 8 levels, enabling dithering mostly redistributes those few levels and the gain shrinks.

Tone, Luminance and Knockout

The tone card controls what the ramp sees. Brightness shifts luminance by -100 to 100 before mapping. Contrast scales it from 50% to 300% around the midpoint: values above 100 push midtones apart and flatten the ends, which helps a washed-out scan but can clip highlights. Gamma runs from 0.3 to 3 and bends the curve instead of scaling it; values below 1 lift shadows, above 1 deepen them.

Blur, 0 to 4 px, is applied by the canvas filter before sampling. A small blur of 0.5 to 1 px reduces noise in photographs and stops a single bright pixel from claiming a dense glyph. Saturation, 0 to 200%, is also a canvas filter, so it changes both the luminance that picks the glyphs and the colors used for tinting; keep it at 100% unless the result looks flat.

Auto levels stretches the histogram to the full range and is useful for flat scans. It is disabled while knockout is on, because the two would fight: knockout already clips everything below the threshold to black. Knockout itself maps cells darker than the threshold (0–255) to the densest glyph, which turns a photo into a stark two-tone stencil. Posterize quantizes the tone curve to 2, 4, 8 or 16 levels, and pairs naturally with the block ramp.

A practical order: pick the ramp first, then width, then brightness and contrast, then dithering, and leave gamma for last. Changing width after tuning tone is fine, but changing the ramp invalidates the tone settings, since each ramp distributes levels differently.

Color, Palettes and Export Formats

Colored output replaces the monochrome glyphs with characters tinted by the color of the pixels underneath. The generator offers 13 palettes: True color, Grayscale, Green, Amber, Cyan, Duotone, ANSI 256, Dracula, Nord, Gruvbox, Solarized, Monokai and Catppuccin. True color keeps the original RGB per cell. The others map that color onto a fixed scheme, which is how a photo becomes a terminal screenshot or a blueprint.

Ink and background colors set the base pair for monochrome output. A transparent PNG background is available for overlaying art on other media, and the PNG font size (4 px and up) decides the raster size. A 200-column art at 10 px yields a PNG around 1200 px wide, because the renderer assumes a 0.6 em advance per character.

Five exports cover the common destinations. TXT is pure text for READMEs, comments and emails. PNG is a raster image, useful for social posts. HTML wraps colored runs in spans inside a <pre>, so the art keeps its colors on a web page without extra CSS. SVG stores one text element per row with colored tspans, which stays sharp at any zoom and can be edited in vector tools. ANSI writes xterm 256-color escape codes, the format terminals, BBS door games and less -R understand.

Copy buttons exist for the plain text and for the colored HTML. Neither touches the network: the file is decoded, sampled, converted and encoded on the device.

A Workflow That Gets a Clean Result

Start with the samples if the source is not ready. Portrait, Landscape and Logo load instantly and show how the same settings behave on different material. Then follow a short sequence.

  1. Drop a file, click the zone or paste with Ctrl+V. PNG, JPG, WebP, GIF, BMP, ICO, AVIF, SVG, TIFF and PDF are handled by the browser's own decoders or the vector path, and 40+ other formats go through a bundled ImageMagick decoder. Files up to 25 MB are accepted.
  2. Pick a preset. Photo sets 140 columns, the detailed ramp, Floyd-Steinberg, contrast 110 and auto levels. Portrait uses 90 columns and the standard ramp. Logo switches to the block ramp with posterization. Terminal goes green on black at 200 columns. Braille and Blueprint cover the two stylized cases.
  3. Adjust width for the destination. A chat message wants 40 to 60 columns, a README 100 to 120, a print piece 200 or more.
  4. Fix the aspect if the result looks stretched, then tune contrast and brightness.
  5. Choose the export. TXT for text, HTML or SVG for the web, PNG for images, ANSI for terminals.

Two habits save time. Crop before converting: a face that occupies a fifth of the frame gets twenty characters at 100 columns, and no setting recovers detail the grid cannot hold. And keep the source large enough: an image narrower than the column count is simply upscaled by the canvas, which adds no information.

FAQ

01What image formats can I convert?

PNG, JPG, WebP, GIF, BMP, ICO, AVIF, SVG, TIFF and PDF are read natively, including the first frame of animated GIFs. Another 40+ formats, such as PSD, HEIC or camera raw, are decoded through the bundled ImageMagick build. Files must stay under 25 MB.

02Why does my ASCII art look stretched?

A text cell is taller than it is wide, so the converter samples fewer rows than columns. The character aspect control, 0.40 to 0.70 with a default of 0.50, sets that ratio. If the place where you paste the art uses a different line height, adjust the aspect until a circle looks round.

03Which ramp should I choose?

Use Standard for small sizes and quick previews, Detailed for photographs at 120 columns or more, Block shading for logos and flat graphics, and Binary or Minimal for a stylized, poster-like look. Katakana gives the Japanese BBS aesthetic, and the custom field accepts your own string of at least two characters.

04Does dithering help with photos?

Yes, when the source has smooth gradients. Floyd-Steinberg spreads the quantization error and produces an organic texture; Bayer gives a regular pattern that holds edges better. For logos and line art, leave dithering off, because the ramp already has enough contrast.

05Is my image uploaded anywhere?

No. The file is decoded and sampled in the browser with the Canvas API, and the conversion, preview and exports all run locally. Nothing is sent to a server, and closing the tab removes the data.

mindia
mindia

Tbilisi, Georgia · SO reputation 7989 · Badges: 5🥇25🥈20🥉 · SO member since 2013