Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fcp-GitHub/image_to_ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Image to ASCII converter

Explanation

image_to_ascii is a simple command-line C implementation of an image-to-ASCII converter.
Given an instruction and the file name, it will recreate a terminal-compatible representation of the given image.
The program uses ANSI escape sequences to print colored output, that is however limited only to the original 8 available colors.
Although the black-and-white functionality seems good, the colored outputs may seem a bit poor due to the really restricted supplied color palette.
At the top of the source file there are two macros (TERM_WIDTH and TERM_HEIGHT) that can be modified as needed in order to change the output size.
For more informations use image_to_ascii -h.

A simple example

As an example, here is an image (generated by a program inspired by scipython.com): And the following is its ASCII form (80x24):

System support

The program should work in every unix system that supports ANSI escape sequences (see for example here).

Dependencies and compilation

In order to compile the given code, two nice single-header file libraries are needed:

After this, compilation is pretty straightforward. For example, using the GNU Compiler:

gcc image_to_ascii.c -lm -o image_to_ascii

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages