A terminal-based image-to-ASCII art converter written in C. Converts images into binary ASCII art using mean-threshold rendering.
- Loads an image (JPEG, PNG, BMP, GIF, TGA, PSD, HDR, PIC, PNM) and converts it to grayscale
- Calculates the mean pixel brightness as a threshold
- Renders pixels above the mean as spaces and below as
*, producing a binary ASCII image - Scales the output to ~128 columns max, adjusting for terminal character aspect ratio (1.75:1)
make
Or directly:
gcc -O3 -march=native main.c -o main
./main
Enter the path to your image:
examples/example_4.jpg
The program prompts for an image path via stdin and prints the ASCII art to stdout.
Place images in the examples/ directory:
./main < <(echo examples/photo.jpg)
None beyond a C compiler. Image loading is handled by stb_image (vendored in vendor/).
