Charcoal is a web app that turns any image into detailed ASCII art, entirely in your browser.
Charcoal takes a photo or picture and redraws it as a grid of text characters, like a charcoal sketch made of type. You can tune the drawing with live sliders, color it in several ways, and download it as SVG, PNG or plain text.
Everything happens on your device. There is no server and no account, and your image is never uploaded. The app is a static Next.js site, and a Web Worker does all the image processing in the background so the page stays responsive.
The app is laid out as one wide sheet with four screens, which you move through from left to right:
Specimen: add an image.
Kiln: watch it being processed.
Easel: adjust the drawing.
Fixative: download it.
- Five color modes:
Mono, 16 colors, Green, Amber and Original colors, on a dark or white ground.
- Live controls: Columns (up to 400), gamma, contrast, white floor, sharpen and CLAHE strength, plus a single
Burn dial that moves several of them at once.
- On-device background removal: An optional U-2-Net model cuts out the subject. It runs in your browser with ONNX Runtime Web.
- Undo and redo: with buttons or keyboard shortcuts.
- Several ways in: Use the file picker, drag and drop an image anywhere, or paste one from the clipboard. A sample image is included.
- Large image handling: Images above a safe size for your device can be converted at a reduced size instead of failing.
- Exports: Animated or still SVG with an optional frame, PNG at up to 4x, and plain text (copy or download).
- Python parity: The image pipeline matches its Python reference on 99.99% of cells, given the same mask.
Open charcoal.daystack.space. Nothing to install.
You need Node.js and npm. The project's CI uses Node.js 24.
git clone https://github.com/n1th1n-19/charcoal
cd charcoal
npm install
npm run dev
To build the static site:
npm run build
This writes a static site to out/. Serve out/ over HTTP with any static file server. Opening it directly from disk does not work, because module workers do not run from file://.
To run the tests:
npm run check
To deploy your own copy, use the Next.js preset on Vercel (vercel.json sets it, with the security headers), or deploy out/ to another host and add those headers yourself. Set NEXT_PUBLIC_SITE_URL to use your own domain.
A rail at the bottom of the page lists the four screens. Click a name to jump to it. You can also:
- Scroll with the mouse wheel or trackpad. One gesture moves exactly one screen.
- Press the
Left and Right arrow keys, as long as focus is not in a slider, checkbox or menu.
Adding an image takes you to the Kiln, and the Kiln hands you to the Easel when it is done.
- Click
Choose image to open the file picker. It accepts JPEG, PNG, WebP, GIF, AVIF and BMP.
- Or drop an image file anywhere on the page, or paste one with your usual paste shortcut.
- Or click
Try the sample to load the built-in sample photo.
Once loaded, the screen shows the file name and its size in pixels. The image is kept at full resolution, on your device only.
The sample loads with its own starting settings: Invert off, Gamma at 1.18 and a white ground, because it is a dark subject on a pale background. Any other image keeps your current settings. Loading a new image clears the undo history.
If the image is larger than your device can safely process, a notice appears instead. See Troubleshooting.
The Kiln shows a temperature that climbs from 20 C to 900 C as the image moves through the pipeline, with a progress bar and the name of the current stage. On wider screens it also lists every stage, crossing them off as they finish. The stages are described in How it works.
The stages run much faster than you could read them, so the Kiln plays them back at a readable pace. When it finishes, you move to the Easel.
If you turn on background removal for the first time, the Kiln also shows the model download, in megabytes.
The Easel shows the drawing and its controls. Every change re-renders the drawing live, and the progress bar shows which stage is running.
Sliders:
| Control |
Range |
Step |
Default |
What it does |
Burn, C |
200 to 900 |
10 |
550 |
One dial over gamma, contrast and CLAHE. 550 leaves them at their base values. |
Columns |
40 to 400 |
10 |
240 |
Width of the drawing in characters. Rows follow from the image's aspect ratio. |
Gamma |
0.4 to 1.8 |
0.01 |
0.8 |
Tone curve applied before choosing a character. |
Contrast |
0.6 to 2 |
0.01 |
1.05 |
Contrast of the grayscale image. |
White floor |
0.4 to 1 |
0.01 |
0.8 |
Brightness above which a cell becomes a blank space. |
Sharpen |
0 to 300 |
10 |
140 |
Strength of the unsharp mask. 0 turns it off. |
CLAHE strength |
0 to 6 |
0.1 |
2.6 |
Local contrast enhancement. 0 turns it off. |
Burn sets gamma, contrast and CLAHE for you. Its gamma base is 0.8 with Invert on and 1.18 with it off. You can still fine-tune each slider afterwards.
Other controls:
Invert: a checkbox, on by default. It inverts the grayscale image before mapping it to characters. Changing it also recalculates the Burn values.
Color: a menu with Mono, 16 colors, Green, Amber and Original colors. The default is Original colors. Mono draws every character in the ink color of the ground. 16 colors snaps each cell to the nearest of the 16 standard ANSI colors. Green and Amber draw everything in a single terminal color. Original colors takes each cell's color from your image.
Ground: a menu with Dark (the default) and White. It sets the background and the ink color.
Remove background (176 MB once): a checkbox, off by default. Turning it on downloads the background model the first time, then sends the image through the Kiln again.
History and finishing:
- The undo and redo buttons step through your changes. A slider records one step when you release it, so one drag is one step.
Done takes you to the Fixative. It is enabled once a drawing exists.
On a phone, the sliders and options are folded away to give the drawing room. Tap Adjust to show them and Close to hide them.
The Fixative has three export cards. Files are named after your image, for example photo-charcoal.svg.
SVG. Scales to any size. The animated version reveals the drawing row by row and plays on GitHub.
Add frame: wraps the drawing in a rounded frame with padding. Off by default.
Smaller file, fewer colors: only shown in Original colors mode. It writes each color with 4 bits per channel instead of 8, which shrinks the file.
Download animated saves <name>-charcoal-animated.svg. Download still saves <name>-charcoal.svg. Each button shows the file size.
If the animated SVG is larger than 1 MB, Charcoal warns you and suggests fewer columns or Smaller file. Above 5 MB it warns that GitHub and browsers may struggle with it.
PNG.
Scale: 1x, 2x, 3x or 4x, with the resulting size in pixels next to each. The default is 2x. At 1x each character is 8 by 15 pixels. Scales that would make either side larger than 16,384 pixels are left out of the menu.
Download PNG saves <name>-charcoal.png. Pixels are scaled without smoothing, so characters stay crisp.
Plain text. Characters only, without color.
Copy text copies the drawing to your clipboard.
Download text saves <name>-charcoal.txt.
| Keys |
Action |
Ctrl + Z (Cmd + Z on macOS) |
Undo |
Ctrl + Shift + Z (Cmd + Shift + Z on macOS) |
Redo |
Left / Right arrow |
Previous or next screen (not while a control has focus) |
| Paste shortcut |
Load an image from the clipboard |
Charcoal has no configuration file. These are the drawing settings and their defaults:
| Setting |
Control |
Default |
| Columns |
Columns |
240 |
| Gamma |
Gamma |
0.8 |
| White floor |
White floor |
0.8 |
| Contrast |
Contrast |
1.05 |
| CLAHE clip limit |
CLAHE strength |
2.6 |
| Sharpen percent |
Sharpen |
140 |
| Burn |
Burn, C |
550 |
| Invert |
Invert |
on |
| Background removal |
Remove background |
off |
| Color mode |
Color |
Original colors |
| Ground |
Ground |
Dark |
Ranges for the sliders are in the Easel table above.
Export options:
| Option |
Default |
Notes |
Add frame (SVG) |
off |
Rounded frame with padding |
Smaller file, fewer colors (SVG) |
off |
Only in Original colors mode |
Scale (PNG) |
2x |
1x to 4x, capped at 16,384 pixels per side |
When you add an image, the page decodes it and hands it to a Web Worker. The worker holds the full-resolution pixels and runs the pipeline:
- Remove background (optional): run U-2-Net to get a mask of the subject.
- Grayscale: convert to gray. If there is a mask, the background is cut out first.
- CLAHE: contrast-limited adaptive histogram equalization on an 8 by 8 grid of tiles, using the
CLAHE strength value as the clip limit. Skipped at 0.
- Invert and lift: optionally invert, then apply a fixed brightness lift.
- Composite: if there is a mask, soften its edge with a small Gaussian blur and paste the subject onto white.
- Sharpen: an unsharp mask with a radius of 2 and a threshold of 2, at the
Sharpen percentage.
- Contrast: blend each pixel toward or away from the image's mean brightness by the
Contrast factor.
- Resample: shrink the image to one pixel per character with Lanczos filtering. Rows are worked out from the column count and the image's aspect ratio, using an 8:15 character cell.
- Sample color: shrink the original color image to the same grid, for the color modes.
- Map to glyphs: turn each cell's brightness into a character.
If your image already has transparency (for example a PNG with an alpha channel), Charcoal uses that as the mask, even with background removal off.
The worker caches the output of every stage, keyed by the settings that stage depends on. When you change a setting, only the stages it affects run again. Changing Gamma or White floor only remaps characters, and changing Color or Ground only redraws the result.
The worker also drops every pending request except the newest one, so dragging a slider never queues up work.
Charcoal uses a ramp of 24 characters, from blank to dense:
.`':,-~=+*ixcoszSXO#%8@
For each cell, the brightness is raised to the power of Gamma. If the result is at or above White floor, the cell is a space. Otherwise darker cells get denser characters, so black always maps to @.
Background removal uses the U-2-Net model in ONNX format. The model is downloaded from Hugging Face the first time you turn the option on, pinned to a fixed commit so it cannot change underneath the site. After download, Charcoal checks its SHA-256 hash and refuses the file if it does not match.
The model runs inside the worker with ONNX Runtime Web, using its WebAssembly build. The image is resized to 320 by 320, normalized, run through the model, and the resulting mask is scaled back to full size. These steps follow the U-2-Net session in rembg. Your image never leaves the device. Hugging Face sees your IP address when you download the model, like any website.
The pipeline is a port of Python image scripts that use OpenCV (cv2) and Pillow. Rounding and edge handling follow those libraries exactly, so the output can be compared against them: grayscale and CLAHE follow cv2, while sharpening, contrast and resizing follow Pillow. The SVG export is a port of the reference SVG script, with the same geometry, timing and escaping.
Given the same mask, the pipeline matches the Python reference on 99.99% of cells. The test suite (npm run check) checks the character mapping and compares CLAHE against real cv2 output, on image sizes that do and do not divide by 8.
A modern browser with:
- Module Web Workers: all processing runs in one.
OffscreenCanvas and createImageBitmap: used to decode images, draw characters and build PNG files.
- WebAssembly: only for background removal, which runs on ONNX Runtime Web.
- Web Crypto (
crypto.subtle): only for background removal, to check the model's hash.
- Clipboard access: only for
Copy text.
Background removal also needs a network connection the first time, for the one-time 176 MB download.
Problem: "is more than this device can safely process". The image has more pixels than Charcoal allows on your device: 16 megapixels on touch devices such as phones, 64 megapixels elsewhere. Click Convert at 16 MP (or Convert at 64 MP) to process a reduced copy, or Cancel. Your original file stays unchanged.
Problem: "This image is too large for this device to read" or "to process". The device ran out of memory while reading or processing the image. Resize it to a smaller size and try again.
Problem: "is not an image". The file you dropped or pasted is not an image type. Use JPEG, PNG, WebP or GIF.
Problem: "This browser could not read". Your browser could not decode the file. Save it as JPEG or PNG and try again.
Problem: "The background model did not load". The download failed, or the file failed its integrity check. Charcoal turns Remove background off again and everything else keeps working. Check your connection and try the option again.
Problem: the animated SVG is very large. Lower Columns, or in Original colors mode turn on Smaller file, fewer colors. The download buttons show the size of each file.
Problem: a PNG scale is missing from the menu. Scales that would make the image wider or taller than 16,384 pixels are hidden. Lower Columns to make larger scales available.
Problem: the built site shows nothing when opened from disk. Module workers do not run from file://. Serve out/ over HTTP.
Charcoal is released under the Apache License 2.0. If you redistribute it or build on it, the license requires you to keep the attribution in its NOTICE file, which credits the project.
Third-party work, each under its own license:
The sample image, app icons, loading art and social image are based on Charcoal 7 by Dati Bendo, European Commission, © European Union, 2026, licensed under CC BY 4.0.