Skip to content

vbxq/aalib-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img1 logo
demo - brightness: 40, font : mda14, scale: 800w


Rust License: BSD-3-Clause Platform

aalib-rs

aalib-rs is an instrument for turning images or videos into live ASCII art

overview

aalib-rs lets you display any picture or video as text

the crate is split in two:

  • aalib-engine/, the low-level renderer
    takes raw pixel data and turns it into characters using luminance tables, dithering, font metrics, etc

  • aalib-player, CLI front-end
    reads images or video (via ffmpeg), runs them through the engine, and streams the result to your terminal.

features

  • full control of gamma, brightness, contrast, inversion, noise and thresholds
  • multiple VGA/MDA/X fonts with CP437-Unicode or ASCII mappings
  • scaling modes: contain, cover, or stretch, live terminal-resize support
  • optional dithering: none, error-distribution, or Floyd–Steinberg

every run can look different: swap fonts, tweak gamma, flip the palette, or crank the dithering

why

  • a modern port of 30-year-old C algorithms; proof that good math outlives old code
  • a compact engine you can read end-to-end and actually learn from
  • easy to hack and adapt for your projects

demo

stream a full video with synced audio in your terminal, example demo command:

.\aalib-player.exe .\b.mp4 --video --fps 60 --scale stretch --font vga9 --bright 40

build

you need ffmpeg and ffprobe installed for aalib-player to work
if you're on Linux, ensure the required system dependencies for ALSA are installed

debian/ubuntu sudo apt install libasound2-dev pkg-config
arch sudo pacman -S alsa-lib pkgconf

you don't need to do any other kind of setup if you're on Windows:

cargo build --release

or simply get it from the releases

license

the source code is licensed under the BSD 3-Clause License, see the LICENSE file for details

bad apple

classic

bad apple
bad apple demo, brightness: 40, font : mda14, scale: stretch
see the full demo

About

hard rewrite of the mythical 1997 aa-lib in rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages