This is a Python project that converts images and videos into ASCII art, with an optional feature to add color to the output.
For more details on how it works, you can check out my blog post about it
- Image and Video Rendering: Supports rendering both static images and video files into ASCII art.
- Color Support: Optionally render ASCII art with color based on the original image or video.
- Customizable Character Set: Switch between different character sets to achieve varying levels of detail in the ASCII output.
- Python 3.6 or higher
- Virtual environment (optional but recommended)
-
Clone the repository:
git clone `https://github.com/davidumoru/ascii-render.git` cd ascii-render
-
Create and activate a virtual environment:
-
On macOS/Linux:
python3 -m venv venv source venv/bin/activate
-
On Windows:
python3 -m venv venv .\venv\Scripts\activate
-
-
Install the dependencies:
pip install -r requirements.txt
To convert an image or video file into ASCII art, run the following command:
python src/main.py <file-path> [options]
-c
: Enable color rendering of ASCII art.-f
: Use a different character set for rendering.
-
Convert an image to ASCII art without color:
python src/main.py src/assets/example.jpg
-
Convert a video to ASCII art with color:
python src/main.py src/assets/example.mp4 -c
-
Convert an image to ASCII art using a custom character set:
python src/main.py src/assets/example.png -f
-
High Contrast Works Best: Choose images with strong light and dark areas for clearer ASCII output.
-
Keep It Simple: Simple compositions with fewer details translate better into ASCII.
-
Resize for Terminal: Ensure your media fits within your terminal’s dimensions to avoid distortion.
-
Slow-Motion for Videos: Slow or simple motions in videos create more recognizable ASCII animations.
-
Grayscale Media: Black-and-white or grayscale images work better for capturing contrast.
-
Optimize Frame Rate: Lower the frame rate for smoother video playback in ASCII.
-
Test with Short Clips: Start with short videos to refine your settings before processing longer ones.
This project is licensed under the MIT License. See the LICENSE file for details.