Skip to main content
ASCII Art Generator

How ASCII Art Generation Works

The Conversion Process

The image converter decodes and samples an image, applies your adjustments, then selects symbols. Standard maps luminance; Edge Detection finds outlines; Character Optimization compares glyph shapes; Emoji Mosaic matches cell colors. These are different algorithms in one editor.

Compare the modes

Load a source image and compare the generated results with the explanation below.

Step 1: Image Processing

  • Decode and sample: The browser loads the source and checks dimensions before allocating the conversion canvas. Canvas drawing and readback happen on the main thread.
  • Geometry: Character modes use rows = max(1, round(columns × source height / source width × 0.55)). This compensates approximately for tall text cells. Character Optimization samples 4×8 pixels per output cell. Emoji Mosaic uses square sampling pixels without the 0.55 factor, then groups them by Emoji Size.
  • Transparency: Character modes composite onto white before adjustments. Emoji mode retains alpha for its later cell-opacity calculation.
  • Adjustments: Brightness, contrast, saturation, hue rotation, sepia and RGB inversion run in that order. Dithering then runs only in Standard and Character Optimization. Neutral settings leave opaque source colors unchanged.

Step 2: Character Mapping

Standard mode calculates luminance L = 0.299R + 0.587G + 0.114B on a 0-255 scale from the adjusted pixels. For N symbols it selects index round((L / 255) × (N - 1)). The ramp is supplied dark-to-light; the code does not measure its visual density.

Darkness Scale (from darkest to lightest):

@%#*+=-:. (including the final space)

Actual output for neutral opaque grayscale pixels with this ten-symbol ramp:

  • Luminance 0/255: @
  • Luminance 128/255: =
  • Luminance 255/255: (space)

Step 3: Text Formation

The process builds the ASCII art by:

  • Processing the image pixel by pixel, from top to bottom, left to right
  • Selecting appropriate characters based on pixel brightness
  • Adding a line break between output rows, retaining blank margins and trailing spaces
  • Keeping the calculated row/column grid; the display font still affects perceived proportions

Technical Considerations

  • Character Sets: Different character sets can create varying levels of detail:
    • Standard: Basic ASCII characters for general use
    • Detailed: A longer printable-ASCII ramp for more mapping levels
    • Minimal: Three Unicode block symbols and a space
  • Proportions: Since ASCII characters are typically taller than wide, the output height is adjusted to maintain proper image proportions
  • Resource limits: Oversized grids are rejected with resize/crop guidance, not silently distorted or truncated.

Generation Modes

Our ASCII art generator offers multiple modes to create different styles of output:

  • Standard Mode: Maps adjusted luminance to the selected character ramp. Start here for a tonal comparison.
  • Edge Detection: Maps local brightness changes to directional line symbols rather than filled tonal areas. Compare the outlines with Standard; weak boundaries can disappear and background texture can add unwanted lines.
  • Character Optimization: Each 4×8 source cell is compared with candidate glyphs rendered in 8 px monospace on a white background. The score blends SSIM (luminance, variance and covariance) with tone similarity, weighted by how textured the source cell is. Detailed cells are matched mostly by structure; flat cells are matched mostly by tone, so a solid gray area becomes a mid-weight character rather than a blank. The highest-scoring glyph wins, with the first candidate retained on ties. Glyph statistics use a bounded cache. The display-font selector does not change this matching font.
  • Emoji Mosaic: Emoji Mosaic groups the resized image into square cells. It averages adjusted RGB values with transparency, chooses a color category, then selects the closest stored brightness in that category from the chosen Emoji Set. If the set has no matching category, it uses brightness alone. It does not recognize objects, emotions or meaning.

Character Optimization runs preprocessing and matching in a cancellable worker when Worker and OffscreenCanvas are available. Without that support, it schedules both preprocessing and glyph matching on the main thread, yielding between bounded steps and checking cancellation. Cancellation is cooperative between steps, not an interruption of an individual native operation. Standard, Edge Detection and Emoji Mosaic conversion run on the main thread. Initial image decoding and canvas drawing/readback also remain on the main thread.

Edge Detection uses Sobel gradients on the average of RGB channels, scales their strength with Edge Intensity, and suppresses non-maximum responses. It selects a line perpendicular to the gradient, not a custom ramp symbol.

Standard and Character Optimization produce plain text by default. Edge Detection uses Unicode lines; Emoji Mosaic uses colored emoji, not sampled RGB. In Standard, Keep source colors adds a preview, HTML and ANSI exports with printable ASCII ramps. Colors are adjusted after transparency is blended onto white; dithering changes glyphs, not colors. ANSI uses white backgrounds and row-local resets; it needs a true-color terminal. Copy, Markdown and TXT remain plain, and PNG remains monochrome. Colored PNG is not supported.

Brightness, Contrast, Saturation, Hue Rotation, Sepia and Invert Colors process the source in all four modes. Neutral settings are 100% brightness, contrast and saturation, 0 degrees hue, 0% sepia and inversion off. A change may leave the same output symbols if it does not cross a matching threshold.

Standard ASCII Art
Character Set and Dithering. Maps luminance to a dark-to-light character ramp.
Edge Detection Only
Edge Intensity. Uses its own directional symbols; Character Set and Dithering do not apply. Inverting an image can leave the same outlines because edge strength and line orientation are unchanged.
Character Optimization
Character Set and Dithering. Matches each image cell to rendered glyphs. More candidates can take longer.
Emoji Mosaic
Emoji Size, Emoji Set and Transparent Pixel Emoji. Sampling Width is the resized pixel width; columns equal width divided by Emoji Size, rounded up. Dithering and Character Set do not apply.

Character Sets

These are the editor's preset names and exact ramps, including each final space. Only Standard, Detailed, Simple and Binary use exclusively printable ASCII; the others contain Unicode symbols.

  • Standard:
    @%#*+=-:. 
  • Detailed:
    $@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,"^`'. 
  • Simple:
    #@%*+=-:. 
  • Binary:
    10 
  • Blocks:
    █▓▒░ 
  • Lines:
    ┃━┗┛┣┫┳┻╋ 
  • Minimal:
    █▄▀ 
  • Dots:
    ●○☉⦿⬤∙. 
  • Shapes:
    ■□▢▣▤▥▦▧▨▩▪▫ 
  • Arrows:
    ←↑→↓↔↕↖↗↘↙ 

The choice of character set affects both the detail level and the style of the final ASCII art. Some sets are better suited for specific types of images or artistic styles.