Skip to content

detechs-debug/Asciify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASCII Video Generator

Warning

Work In Progress

This project is still under active development. The implementation is currently unoptimized and may contain bugs, inefficiencies, and incomplete features. Performance improvements and additional functionality are planned for future releases. See the Future Improvements section for the planned work.

Convert images and videos into ASCII-art representations using Rust and FFmpeg.


Demo

Image Conversion

Image

Video Conversion

ascii_video_compressed.mp4

Overview

This project converts images and videos into ASCII art by mapping pixel brightness values to text characters of varying visual density.

For videos, the workflow consists of:

  1. Extracting video frames.
  2. Converting each frame into ASCII art.
  3. Rendering the ASCII representation back into image frames.
  4. Combining the generated frames into a final video.

Installation

Nix Users

Run directly (no clone needed):

nix run github:devnchill/Asciify

Build locally:

git clone https://github.com/devnchill/Asciify
cd Asciify
nix build

Non-Nix Users

Requires Rust and ffmpeg on your system.

git clone https://github.com/devnchill/Asciify
cd Asciify
cargo run --release

Contributing

Check the open issues if you'd like to help out.

Nix users: simply run nix develop to get a shell with all dependencies (Rust toolchain + ffmpeg).


Future Improvements

  • Faster frame processing
  • Parallel frame generation
  • Colored ASCII output
  • Custom character ramps
  • Adjustable output resolution
  • Audio preservation
  • Better font rendering
  • Reduced memory usage

How It Works

1. Frame Extraction

The input video is decomposed into individual frames using FFmpeg.

Input Video
     │
     ▼
Frame 000001.png
Frame 000002.png
Frame 000003.png
...

Each frame is stored as a PNG image for processing.


2. Image Processing

For every frame:

  • The image is loaded into memory.
  • The image is resized to the target ASCII dimensions.
  • Pixel brightness values are calculated.

Conceptually:

Dark Pixel  ─────► Dense Character
Bright Pixel ───► Sparse Character

3. Character Mapping

Each brightness value is mapped to a character from a predefined density ramp.

Example:

@%#*+=-:.

Darker pixels become:

@
#
%

Brighter pixels become:

.
:
-

This creates the illusion of shading using only characters.


4. ASCII Frame Generation

After mapping, each frame becomes a text-based representation.

Example:

@@@@@@@@@@@@@@
@@@@@@##***++=
@@@##*++==--::
###*++==-::...

The ASCII output is then rendered back into an image frame.

This step allows standard video encoders to process the output.


5. Video Reconstruction

Once all ASCII frames have been generated, FFmpeg combines them into a video.

ASCII Frames
      │
      ▼
FFmpeg Encoding
      │
      ▼
ASCII Video (.mp4)

The final result preserves the original motion while displaying every frame as ASCII art.


Pipeline

Input Video
     │
     ▼
Frame Extraction
     │
     ▼
PNG Frames
     │
     ▼
ASCII Conversion
     │
     ▼
ASCII Frames
     │
     ▼
Video Encoding
     │
     ▼
ASCII Video

Tech Stack

  • Rust
  • FFmpeg

About

A Rust CLI that converts images and videos to ASCII art

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 80.3%
  • Nix 19.7%