ASCII.CAFE / DEVELOPER REFERENCE

Build with
living ASCII.

From a shareable look to an interactive canvas. Start with a working example, then find the settings and lifecycle details you need.

Canvas 2DBrowser renderingLive interaction

One field. Four renderers. Move your pointer across the preview.

Your first render

Start in the workspace without installing anything. This link loads a procedural field and a look; try it, change the settings, then use your own media.

Workspace URL
https://ascii.cafe/app?v=1&s=orbit-sphere&cw=terminal&lv=8
  1. Choose a sourceUse a field, image or clip. Camera and screen capture begin with a permission prompt.
  2. Shape the outputSet the alphabet, density, tones and motion in the workspace.
  3. Choose how it travelsShare settings, export pixels, or use a licensed interactive integration.

What the workspace is

The workspace at /app turns a picture, a video, a camera or a shared screen into ASCII characters, halftone discs, ordered dither or line art, live. Lines includes engraving, flow and contour styles. Rendering and exports run in the browser without a visitor account. Optional feature submissions upload ASCII frame JSON, a cover image and chosen public credit after consent; original files stay local, but Show Original Background includes rendered source pixels in the submitted capture.

Shareable rendering settings live in the address bar. A link reproduces a look; a settings file carries the same keys as JSON. The Settings links section documents both.

Choose an integration

Activate a Developer key in the workspace, then choose Developer > Download ZIP. The ZIP includes Artwork.jsx, standalone index.html, player modules, artwork.json and Setup.pdf. Bake Frames captures 1 to 30 seconds at 32 fps. Include Original Asset bundles the full image or video for live rendering. Keep the folder together for React and module integration. The standalone HTML works offline. The paths below are local filenames in your project, not public CDN downloads.

Choose a download mode

Bake Frames samples 1 to 30 seconds at 32 fps. Files and generated fields are sampled offscreen at exact times; camera and screen feeds record in real time with the tab visible. Include Original Asset bundles an image or video up to 128 MB and renders the full media live. Generated fields and live feeds use Bake Frames.

Layout, backgrounds and motion

The player preserves the captured aspect ratio and scales to its container. Solid, linear and radial backgrounds retain their settings. Show Original Background includes rendered source pixels: baked backgrounds use JPEG or transparent PNG frames up to 960 pixels; original-asset mode retains source resolution. Halo and ripples remain interactive when enabled. Reduced motion holds the first frame and disables motion effects. Shimmer, Spotlight, Code Glitch, Flicker, Scanlines, Breathe, Heartbeat, Focus and Wipe operate on Characters with Alphabet style. Wave and Jelly bend Characters with Alphabet style and connected Lines. Contour Wave Motion sends one broad crest through whole contour strokes; Wavy Lines bends them with a rolling wave. Contour Wave Motion requires Contour Lines; Wavy Lines also supports Characters with Alphabet style and other Lines. Glow works across all algorithms. Baked frames retain their motion parameters; plain text has no position or glow channel.

Limits and troubleshooting

Baked captures are limited to 32 million grid cells across all frames and 128 MB of artwork JSON. Lower density or duration if a bake is too large. A repeating baked segment can have a visible seam. Speed 0 holds the source. To change a baked look, export again. Keep all ZIP files together for React or module integration; the standalone index.html embeds its dependencies and artwork for offline playback.

ANY PAGE

Mount the engine into a sized element. Keep the returned instance to update settings or release it later.

ANY PAGE
<div id="stage" style="height:480px"></div>
<script type="module">
  import GlyphRaster from "./glyph-raster.js";
  const art = new GlyphRaster(document.querySelector("#stage"), {
    ramp: " ·K■|", density: 90, pointerAmount: 0.5,
  });
  // Call art.destroy() when the host is removed.
</script>

REACT COMPONENT

Import a generated component into a client component. Give its container a defined size.

REACT COMPONENT
// exported from the workspace
import Pour from "./Artwork.jsx";

export function Hero() {
  return <Pour />;
}

STANDALONE HTML

Host the standalone player alongside your site and give its iframe a descriptive title.

STANDALONE HTML
<iframe src="/artwork/index.html"
  title="my pour"
  style="width:100%;height:480px;border:0">
</iframe>

Connect a source

Choose the source you own. Keep the same engine instance when the source or styling changes.

Images

Load a File, Blob or public URL with setImage(). Check the resolved success value, then wait for onFrame before exporting. Remote servers must allow cross-origin access.

Video

Use setVideo() for a file or URL, or setSource() with a video element you control. Decode a frame before capturing it.

Camera & screen

Request access from a click on HTTPS or localhost. A settings link cannot grant permissions or restore a screen-sharing session.

Update the current instance
// art is the engine instance from the entry-point example.
// file is a File from your image input.
const loaded = await art.setImage(file);
if (!loaded) throw new Error("Image could not load");
art.update({ density: 100, sourceFit: "width" });

// Wire this to a user click.
shareButton.addEventListener("click", () => {
  art.enableScreenShare();
});

// Call this cleanup when the host unmounts.
function cleanup() {
  art.destroy();
}

Make it interactive

Halo and ripples respond to input in a live player. PNG, GIF and MP4 preserve rendered pixels; they cannot respond to a new pointer after export.

Live interaction options
art.update({
  pointerAmount: 0.35,
  pointerRadius: 0.25,
  rippleAmount: 0.3,
  rippleSpeed: 1,
  pointerMask: "everywhere",
  rippleMask: "everywhere",
});

Respect reduced motion

The engine supports the visitor’s reduced-motion preference. Keep decorative motion optional and provide a meaningful description for the canvas.

Let the page scroll

A touch preview should not capture every drag. Keep scrolling available and treat hover effects as an enhancement.

Keep the grid intentional

More columns mean smaller characters and more work per frame. Give the container a real height, then tune density and cadence together.

The engine

The engine that draws this site is one JavaScript file with no dependencies. It draws into a box you give it, takes one options object, and rendering settings can be changed in place while it runs. Pass onFrame and onStatus callbacks when constructing the engine.

It is not a free download. Using it in your own pages needs the developer license, which covers one commercial project. What the license includes is on the price board and in the license section below.

Engine entry point
<div id="stage" style="height:480px"></div>
<script type="module">
  import GlyphRaster from "./glyph-raster.js";
  const art = new GlyphRaster(document.querySelector("#stage"), {
    ramp: " ·K■|", density: 90, pointerAmount: 0.5,
  });
  // Call art.destroy() when the host is removed.
</script>

The constructor is GlyphRaster and the file is glyph-raster.js.

Options

Search by option, group or behavior. Defaults are the engine's own; the Values column notes workspace differences.

56 of 56 entries

engine options
NamePurposeValuesDefault
markMotionMARKS AND ALPHABETMark-level animation. Wave and Jelly bend glyphs and connected lines; Shimmer, Spotlight, Code Glitch, Flicker, Scanlines, Breathe, Heartbeat, Focus and Wipe affect glyphs. Contour Wave Motion sends one broad crest through contour strokes; Wavy Lines bends glyphs and connected lines. The host supplies the phase.none, wave, shimmer, spot, code, flicker, scan, breathe, jelly, beat, cascade, contourwave, focus, wipenone
markPhaseMARKS AND ALPHABETPosition in one repeating motion cycle, recorded in frame appearance for replay.0 to 10
markAmountMARKS AND ALPHABETStrength of mark motion; zero draws the unanimated marks.0 to 10
sourceSOURCE AND FITWhat is drawn: a built-in moving field by id, or image, video, webcam or screen once one is attached.orbit-sphere, gallop, drape, plasma, merge, converge, dispatch, sweep, image, video, webcam, screenorbit-sphere
thoughtSOURCE AND FITThe seed phrase the fields are drawn from. The same phrase always draws the same motion.any short stringa slow tide
sourceFitSOURCE AND FITHow a picture with its own aspect fills the lattice: cover it, or match its width or its height and band the rest.cover, width, heightcover
matInsetSOURCE AND FITAn empty margin around the picture, in percent of the box.0 to 40 (workspace: 0 to 14)0
lineDirectionMARKS AND ALPHABETDirection of line strokes without rotating the source.vertical, horizontalvertical
portraitTextMARKS AND ALPHABETRepeating text for typography; size and weight follow tone.1 to 96 charactersstay curious keep looking
markTypeMARKS AND ALPHABETHow the image is drawn: characters, dots, lines, or repeating text.glyph, dotRadius, ditherDot, engraving, flow, contour, typographyglyph
rampMARKS AND ALPHABETThe alphabet, darkest first. A literal string; a leading space leaves the darkest cells empty.2 to 16 characters ·K■|
levelsMARKS AND ALPHABETHow many brightness levels the picture is cut into. Raised to the alphabet's length when it is longer.2 to 165
dotValueMARKS AND ALPHABETHalftone only: the disc's alpha follows its level as well as its size.true, falsefalse
densityMARKS AND ALPHABETCells across the box. The cell size follows from the box's width.a positive integer (the workspace pins the cell size and derives this)90
cellAspectMARKS AND ALPHABETThe width of a cell relative to its height.0.2 to 4 (workspace: 0.5 to 1.6)1
contrastTONEStretches or flattens the difference between dark and bright.0.05 to 8 (the workspace uses 0.6 to 2)1
brightnessTONELifts or lowers the whole picture before it is cut into levels.-1 to 1 (the workspace uses -0.5 to 0.5)0
ditherTONEAn ordered pattern that breaks up flat bands between levels.0 to 10
invertTONESwaps dark and bright.true, falsefalse
inkCOLORThe color the marks are drawn in. An eight-digit value carries an alpha.a CSS hex color#ffffff
groundCOLORThe color behind the marks.a CSS hex color#000000
groundFillCOLORPaint the ground every frame, or clear to real alpha so exports carry transparency.opaque, transparentopaque
inkModeCOLORMap foreground colors by brightness or across the canvas.tone, gradienttone
inkAngleCOLORForeground gradient angle. 90 runs left to right.0 to 36090
inkPaletteCOLOROne ink or custom palette stops; inkMode chooses brightness mapping or a spatial gradient.single, customsingle
paletteCOLORCustom colors: darkest first in tone mode, spatial stop order in gradient mode.2 to 16 hex stops, comma separated#aa30be, #c742dd, #f3aeff, #ffffff
keyColorsCOLORRemoved colors: a cell whose source color matches one draws nothing.up to 16 hex colors, comma separated; empty is offempty
keyToleranceCOLORHow close a source color has to be to a removed color to count.0 to 10.18
groundSourceCOLORShow the original source behind the marks.true, falsefalse
groundOpacityCOLOROpacity of solid or gradient background paint, independent of marks.0 to 11
groundSourceOpacityCOLOROriginal source opacity over the background.0 to 11
groundModeCOLORBackground fill shape.solid, linear, radialsolid
groundPaletteCOLORBackground gradient stops.2 to 5 six-digit hex colors, comma separated#101828, #312e81
groundAngleCOLORLinear gradient angle in degrees.0 to 36090
keyTargetCOLORLayer affected by removed colors.effect, background, botheffect
keyTolerancesCOLORPer-color effect tolerance overrides.JSON object mapping six-digit hex colors to 0 to 1 tolerancesempty
backgroundKeyColorsCOLORColors removed from the original background.up to 16 hex colors, comma separatedempty
backgroundKeyToleranceCOLORDefault background color-removal tolerance.0 to 10.18
backgroundKeyTolerancesCOLORPer-color background tolerance overrides.JSON object mapping six-digit hex colors to 0 to 1 tolerancesempty
speedMOTIONHow fast a field or a clip the engine owns plays.0 to 8; 0 holds the source1
pulseMOTIONA slow, even brightening and dimming of the whole picture.0 to 10
holdFpsMOTIONHow many times a second the box redraws.1 to 240 (workspace default: 16)60
pointerAmountINTERACTIONHow much the cells under the pointer brighten.0 to 10
pointerRadiusINTERACTIONHow far the halo reaches from the pointer, as a share of the box.0.02 to 2 (workspace: 0.05 to 0.8)0.25
pointerMaskINTERACTIONWhether the halo lights empty cells too, or only cells that already carry a mark.everywhere, foregroundeverywhere
rippleAmountINTERACTIONHow strongly a click or a pointer trail sends a ripple.0 to 10
rippleSpeedINTERACTIONHow fast a ripple travels.0.3 to 31
rippleMaskINTERACTIONWhether a ripple crosses empty cells, or only cells that already carry a mark.everywhere, foregroundforeground
rippleInkINTERACTIONWhether a rippled cell keeps its own ink, takes one color, or takes a color from ripplePalette by strength.inherit, single, paletteinherit
rippleColorINTERACTIONThe ripple's color when rippleInk is single.a CSS hex color#ff6fd8
ripplePaletteINTERACTIONThe ripple's colors, weak to strong, when rippleInk is palette.2 to 16 hex stops, comma separated#c742dd, #ff6fd8, #ffd6f2, #ffffff
rippleMoveScaleINTERACTIONThe size of a ripple sent by a moving pointer, relative to the base ring.0.05 to 41
ripplePressScaleINTERACTIONThe size of a ripple sent by a press, relative to the base ring.0.05 to 41
descriptionACCESSIBILITY AND CALLBACKSThe text alternative written onto the canvas for screen readers.a sentencea description of the turning form
onFrameACCESSIBILITY AND CALLBACKSCalled after every drawn frame with the time in milliseconds and the playback position in seconds. Constructor only.a function (nowMs, seconds)none
onStatusACCESSIBILITY AND CALLBACKSThe engine's one outbound channel: a line of text whenever something a host should know happens. Constructor only.a function (message)none

Reduced motion is honoured by the engine on its own: one frame, no ripples.

Methods

  • getSourceFrame(maxSide = 640)Copies the current unprocessed image or media frame into a reused local canvas, capped at 1920 pixels. Returns null for procedural or unavailable sources. Does not acquire or control streams.
  • update(options)Applies rendering settings in place. Set onFrame and onStatus callbacks in the constructor.
  • setSource(fieldIdOrFunctionOrElement)A core built-in field id, custom luminance function, or image, video or canvas element you own. Workspace cafe-* field ids require the site's field functions; they are not core string ids.
  • setImage(fileOrAddress)A File, a Blob or an address. Resolves true when it took and false with a status when not. Pictures up to 32 MB, scaled to 2048 px on the long edge.
  • setVideo(fileOrAddress)The same for a clip the engine then owns, up to 512 MB.
  • enableWebcam()Call it inside a click. Resolves true when the camera is live.
  • enableScreenShare()The same for a window, a tab or a screen. screenShareSupport() says whether the browser can.
  • setPlaying(on)Pauses or resumes playback.
  • seek(seconds)Renders the frame at that time without changing the play state.
  • snapshot(type?)The current frame as a data URL, PNG by default.
  • toText()The frame as real characters, one line per row.
  • destroy()Stops everything, releases the camera and the clip, removes what it added.

Additional state and playback methods: getParams, getGrid, getSourceState, getSourceFit, mediaRate, restart, screenShareSupport. The color key set: eyedropperSupport, armEyedropper, disarmEyedropper, addKeyColor, getKeyState.

Pixels, settings & ASCII JSON

A settings file describes how to render a source. An ASCII capture contains the rendered character-level grids. They solve different problems.

Settings

Reapply the look to another source. Imported media is not embedded in a settings link. Match the settings version when reading JSON.

ASCII capture

Keep grid dimensions, level rows, alphabet and colors. A player can scale the complete canvas without reducing its original density.

Feature submission

Request to feature records six seconds at up to 24 fps, reduced for dense grids. It uploads ASCII JSON and a cover with consent. Original files stay local. Show Original Background includes rendered source pixels as bounded JPEG frames; review them before consenting.

Capture one rendered ASCII frame
// Run after the source has loaded and onFrame has fired.
const frame = art.captureAscii({
  mode: "frame",
  text: true,
});

// Contains the rendered grid, ramp and level rows.
// This is different from a settings-only file.
const json = JSON.stringify(frame);

The site’s feature player reapplies pointer effects to quantized levels. Ripple edges can differ from the live source, and a recorded loop may have a visible seam. Captured artwork is not the editable original media.

Exports by plan

FormatFreePro
PNGClean, up to 1080pClean, up to 4K
TextClean, current frameClean, current frame
GIFUp to 6 s at 30 fps, up to 1080p, a small stamp bottom rightUp to 30 s, 60 fps up to 1080p and 30 fps at 4K, clean
MP4Not on the free planUp to 120 s, 60 fps up to 1080p and 30 fps at 4K, clean, where the browser can encode H.264
Camera and screenLive on the stage, clean stillsClean GIF and MP4 recording at the canvas size
Settings link and settings fileEvery planEvery plan
Saved settingsOne slot on this deviceSeveral named looks

Camera and screen recording uses the current canvas size. Resolution and frame rate depend on the source, browser and device. MP4 has an opaque background; use PNG or GIF for transparency.

Pro is $8 a month or $49 once for Lifetime Pro V1. Lifetime Pro V1 excludes major version upgrades.

When something looks wrong

The canvas is empty

Check the container height, wait for the source to finish loading, and inspect getSourceState(). A remote URL also needs appropriate CORS headers.

My camera or screen will not start

Use HTTPS or localhost and call the permission method directly from a user click. A previous permission does not let a link restart a capture session.

My picture looks cropped

Use sourceFit: width or height to keep that dimension visible. Cover fills the available area and can crop the other dimension.

My preview looks too coarse

Density is a column count in the engine. Increase it for a finer live grid. For captured ASCII, preserve the stored grid and scale the canvas rather than rebuilding a smaller grid.

MP4 is unavailable

The workspace checks browser H.264 encoding support. Use GIF when MP4 encoding is not available.

My React page keeps creating canvases

Create one instance after mount, update it in place, and call destroy() from the effect cleanup. Avoid constructing an engine during render.

The developer license

DEVELOPER LICENSE$39· Once, per project

The engine that draws this page, as one file you can ship: no dependencies, no server and no attribution required. One license applied to a single website or project.

  • React component or standalone HTML exports
  • Commercial use, one project per license
  • Interactable, with mouse movement responses
  • Attribution not required, credit welcome

IT ALLOWS

  • Commercial use.
  • One website or project per license.
  • No attribution required, credit welcome.
  • The engine shipped inside your own product, as the component or the player.

IT DOES NOT ALLOW

  • Removing the stamp from a free export.
  • Embedding the engine without a license.
  • One license across several projects.

Pro plans cover what the workspace exports; the developer license covers shipping the engine itself.

GET THE LICENSE →

We use cookies to help us understand what works. Learn more in our Privacy Policy.