- Convert any image into ASCII art.
- Two shading levels:
simple
andcomplex
ASCII character sets. - Adjustable output dimensions (width/height) and automatic aspect ratio adjustment.
- Supports grayscale images with detailed pixel mapping to ASCII characters.
-
Clone the repository
git clone https://github.com/yourusername/DumbASCIIArt.git cd DumbASCIIArt
-
Install Dependencies Make sure you have OpenCV installed on your system. On Linux, you can install it using the following command:
sudo apt-get install libopencv-dev
-
Build the Program Compile the program using
g++
. Ensure OpenCV is properly linked:g++ DumbASCII.cpp -o ascii_art `pkg-config --cflags --libs opencv4`
Run the program with the following syntax:
./ascii_art <image_path> [width] [height] [shade] [outfile]
- image_path: Path to the image file (supports
.jpg
,.png
, etc.). - width (optional): Desired width of the ASCII output. Default is 100.
- height (optional): Desired height. If set to
0
, the height is auto-calculated to maintain aspect ratio. - shade (optional): Choose between
simple
(default) andcomplex
ASCII character sets. - outfile (optional): Specify the output file to save the ASCII art. If not provided, output is printed to the console.
Convert an image (sonic.jpg
) to ASCII art with complex shading and a width of 50 characters:
./ascii_art sonic.jpg 50 0 complex output.txt
- Simple ASCII Character Set:
░▒▓█@#S%?*+;:,.
- Complex ASCII Character Set:
.:-=+*#%@$@B%8&WM#*abcdejfQGUYlmno0pqrstuvwxyz▓▒░█▓█
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature-branch
). - Commit your changes (
git commit -m "Add new feature"
). - Push to the branch (
git push origin feature-branch
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for details.