Skip to content
JacobDChamberlainPublic

About

Convert images & videos into ascii, at different resolutions!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Asciify

A mobile-friendly, fully client-side web app that converts images and video into an ASCII-pixelated rendering in real time. Nothing is uploaded — all processing happens in your browser.

Features

  • Images & video — accepts common web-decodable formats via file picker or drag & drop.
  • Live preview — video plays back as animated ASCII in real time.
  • Resolution toggle — a slider controls how many characters span the frame (more columns = smaller characters = more detail).
  • Mono / Color modes — classic single-ink ASCII, or each glyph tinted with its source pixel color. Mono mode has a color picker for the ink.
  • Charsets — Standard, Detailed, and Blocks ramps.
  • Invert — flip the light/dark mapping (useful for light backgrounds).
  • Export
    • Images → PNG download.
    • Video → WebM recording of the ASCII animation (via MediaRecorder).

Running locally

Because the app uses native ES modules, open it through a local web server (opening index.html via file:// will be blocked by the browser's module CORS rules).

# any static server works — pick one:
npx serve .
# or
python3 -m http.server 8000

Then visit the printed URL (e.g. http://localhost:8000).

To test on your phone, serve from your computer and visit http://<your-computer-lan-ip>:8000 on the same Wi-Fi network.

Project structure

asciify/
├── index.html              # markup + control layout
├── css/styles.css          # mobile-first dark theme
└── js/
    ├── main.js             # UI orchestration + app state
    ├── asciiRenderer.js    # core engine: source → grid → glyphs → canvas
    └── exporters/
        ├── index.js        # exporter factory + the video-exporter contract
        ├── pngExporter.js  # image → PNG
        └── webmExporter.js # video → WebM (MediaRecorder)

Known limitations

  • Video format support depends on the browser's codecs, not this app. MP4 (H.264) and WebM decode reliably everywhere; containers like .mov, .avi, and .mkv are hit-or-miss. If a file can't be decoded you'll get a clear error message rather than a silent failure.
  • Exported video is WebM. Some environments — notably older iOS Safari — have limited WebM playback/recording. See the MP4 upgrade path below.
  • Audio is not included in exported video.
  • The output canvas renders at CSS-pixel density (not devicePixelRatio) to keep the real-time video loop fast on phones; still images therefore favor speed over maximum sharpness.

Upgrade path: MP4 export

Export is intentionally structured so MP4 can be added without touching the app logic. Everything goes through the exporter factory in js/exporters/index.js, which defines a single contract:

class SomeExporter {
  static format = 'webm';        // short id
  static label  = 'WebM';        // human label
  static isSupported(): boolean  // feature-detect in this browser
  constructor(canvas, opts)      // opts: { fps, mimeType }
  start(): void                  // begin capturing frames
  async stop(): Promise<{ blob, filename, mimeType }>
}

To add MP4:

  1. Create js/exporters/mp4Exporter.js implementing the contract above. Two common approaches:
    • ffmpeg.wasm — capture frames from the canvas and encode to MP4. Highest compatibility, but heavy (large WASM download, slower, memory-hungry on mobile).
    • WebCodecs + an MP4 muxer (e.g. mp4-muxer) — hardware-accelerated VideoEncoder where available. Much faster/lighter, but newer-browser only.
  2. Import it in js/exporters/index.js and add it to the VIDEO_EXPORTERS array. Put it before WebmExporter to make MP4 the preferred default, or after it to keep WebM as the fallback.

No other file needs to change — main.js only ever calls createVideoExporter(canvas, opts) and uses the returned instance through the contract. The record button, download flow, and UI all keep working as-is.

License

MIT — do whatever you like.

About

Convert images & videos into ascii, at different resolutions!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages