# ASCII Video Renderer
A **real-time ASCII rendering engine** that converts images, videos, or live webcam input into ASCII art, with optional **true-color output**. The project focuses on **performance-aware image processing**, clean CLI design, and modular rendering using OpenCV.
## Features
* Multiple input sources*
* Webcam (by index)
* Video files (.mp4, .avi, …)
* Single images (.jpg, .png, …)
* *Color or grayscale ASCII output*
* Configurable ASCII resolution (width in characters)
* Real-time rendering using OpenCV
## How It Works (High Level)
1. Capture a frame from the selected source
2. Convert the frame to grayscale for luminance analysis
3. Downsample the frame to ASCII resolution
4. Map pixel intensities → ASCII characters
5. Render characters using:
* grayscale color, or
* original pixel color (true-color ASCII)
Grayscale is used **only** for character selection; color (if enabled) is preserved from the original frame.
## Requirements
* Python
* OpenCV
* NumPy
## Command-Line Arguments
| Argument | Description | Default |
| ---------- | --------------------------------------- | -------- |
| --source | Webcam index, video path, or image path | 0 |
| --width | ASCII output width (characters) | 100 |
| --color | Enable true-color ASCII rendering | Disabled |
## Usage
### Webcam (default camera)
python main.py --source 0
### Webcam with color ASCII
python main.py --source 0 --color
### Video file input
python main.py --source video.mp4 --width 120 --color
### Single image input
python main.py --source image.jpg --width 100
The image renderer displays once and exits when you press **q** or interrupt the program via keyboard