English | 繁體中文
The project is a simplified C language version of ASCII-generator.
It aims to reimplement part of its core functionalities in C, providing a simple tool for converting images into ASCII art.
- Focuses on converting images to ASCII art. Convertion for videos is not included at this stage.
- Simplifies the multilingual character sets from
ASCII-generator, providing only general-purpose character sets and english character set.
| File Name | Description | Status |
|---|---|---|
img2txt.py |
Image → Text | ✓ |
img2img.py |
Image → Grayscale ASCII Art | ✓ |
img2img_color.py |
Image → Colored ASCII Art | ✓ |
-
Build Executable
You can use either theMakefileorscript/build.ps1to compile the source code.
The build process will generatemain(Unix/Linux) ormain.exe(Windows). -
Run
mainParameters --type Required. Function type. --input Required. Path to the input image. --output Required. Path to the output file. --num_cols Optional. Number of output columns. --mode Optional. Character set. --background Optional. Background color. Accepted values and defaults --type ["text", "image", "image_color"] --input Path string --output Path string --num_cols Integer Default: 300 --mode ["simple", "complex", "english"] Default: complex --background ["white", "black"] Default: black./main --type text --input ./input.png --output ./output.txt
./main --type image --input ./input.png --output ./output.png --mode complex --background black
./main --type image_color --input ./input.png --output ./output.png --num_cols 200 --mode simple --background white
Image to Grayscale ASCII Image

Below are two comparisons. Each group contains three images, in order:
- Original image
- Image generated by ASCII-generator
- Image generated by Image-ASCII-Art
- vietnh1009/ASCII-generator:Original logic for image-to-ASCII conversion.
- nothings/stb:Lightweight C image processing tool.











