ASCII Generator is a C++ tool that converts images into expressive ASCII art using only stb_image.h. It reads images (like JPEG or PNG), calculates pixel brightness, and maps them to ASCII characters — creating stunning terminal-style visuals.
- 🖼️ Load
.jpg,.png, and other formats viastb_image.h - 🎨 Outputs ASCII representation directly in terminal or to a file
- 📏 Adjustable resolution and scaling
- 💡 Customizable character sets
- 🔧 Lightweight and dependency-free (besides
stb_image.h)
ascii-generator/
├── include/ # Header files (AsciiEngine.h, stb_image.h)
├── src/ # Source files (AsciiEngine.cpp, main.cpp)
├── bin/ # Compiled binary output
└── Makefile # Easy build configurationMake sure you have a C++ compiler (e.g., g++ or clang++) installed.
git clone https://github.com/zmn17/ascii-generator.git
cd ascii-generator
makeAlternatively:
g++ -std=c++17 -Iinclude -o bin/ascii-art src/*.cpp./bin/ascii-art path/to/image.jpgOptionally, customize brightness mapping and resolution via the code or command-line (if implemented).
@##%%==--...
++==--::..
...
✨ Want colorized ASCII in terminal? Check out
\033[1;Xmescape codes in C++.
stb_image.h(included in repo)
- Add grayscale image saving
- Add CLI support for resolution and output path
- Add more character set presets
- Export colored ASCII to HTML or SVG
Licensed under the MIT License.
Credit to nothings/stb for image loading.