Skip to content

ultroned/starcii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

starcii

A terminal-based image-to-ASCII art converter written in C. Converts images into binary ASCII art using mean-threshold rendering.

How it works

  1. Loads an image (JPEG, PNG, BMP, GIF, TGA, PSD, HDR, PIC, PNM) and converts it to grayscale
  2. Calculates the mean pixel brightness as a threshold
  3. Renders pixels above the mean as spaces and below as *, producing a binary ASCII image
  4. Scales the output to ~128 columns max, adjusting for terminal character aspect ratio (1.75:1)

Build

make

Or directly:

gcc -O3 -march=native main.c -o main

Usage

./main
Enter the path to your image:
examples/example_4.jpg
Output example

Output of examples/example_4.jpg

The program prompts for an image path via stdin and prints the ASCII art to stdout.

Examples

Place images in the examples/ directory:

./main < <(echo examples/photo.jpg)

Dependencies

None beyond a C compiler. Image loading is handled by stb_image (vendored in vendor/).

About

A command-line tool that displays images as ASCII art using asterisk (*) characters in the terminal.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors