TermChroma is a powerful command-line utility for converting images into ASCII art, complete with an interactive TUI, multiple color gradients, and the ability to save the output (including ANSI color escape codes) to a file.
- Version: 1.1.0
- License: MIT (or your choice)
- Multiple ASCII Sets: Choose from built-in sets or define your own with
--chars. - Multiple Color Modes: None, grayscale, rainbow, blue2red, or custom color mapping.
- Interactive TUI:
- Resize your ASCII art on the fly.
- Change character sets with arrow keys.
- Toggle color modes with
C. - Press
Qto quit. - Art is always scaled to fit the terminal window, so it never overflows.
- Single-shot Conversion: Use
--no-tuito simply convert and print or save the ASCII art. - Save to a File: Use
-o/--save <file>to write ASCII output (with color codes) to disk. - 256-Color Table:
--random-colorsdisplays a color swatch chart.
- Python 3.6+
- Pillow for image processing
pip install Pillow- Clone or download this repository.
- Place
termchroma.pyin a directory within your$PATH, or just run it locally. - Ensure you have Python 3 and Pillow installed.
termchroma.py [OPTIONS] [IMAGE]
Key Options:
-o, --save <FILE>
Save the ASCII art toFILE(including ANSI color if any).--scale <FLOAT>
Initial scale factor (default0.5).--chars <STRING>
Override the default ASCII characters for brightness mapping.--gradient {none,grayscale,rainbow,blue2red,custom}
Pick a color mode.--no-tui
Disable interactive TUI; convert once and print/save ASCII art.--random-colors
Display a 256‐color demonstration table, then exit.--resize-filter {nearest,bilinear,bicubic,lanczos}
Pillow resize method (defaultlanczos).-v, --version
Print version and exit.-h, --help
Show help message and exit.
- Up/Down: Increase/decrease scale.
- Left/Right: Cycle through different ASCII character sets.
- C (or
c): Cycle color modes. - Q (or
q): Quit TUI.
- Basic TUI:
termchroma.py myphoto.jpgtermchroma.py myphoto.jpg --no-tui --gradient rainbow
termchroma.py myphoto.jpg --no-tui --scale 0.4 --gradient rainbow --save out.txt
termchroma.py --random-colors
MIT License (or whichever license you prefer). See LICENSE file for details. Contributing
Fork the repo and create your branch from main.
Make changes or add new features.
Submit a pull request.
Author
Kleinpanic
Enjoy TermChroma for your ASCII art needs!