Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icat

Display images directly in a terminal by emitting ANSI escape codes.

Requirements

  • Python 3.8 or later
  • Pillow
  • A terminal that supports ANSI color output

Install dependencies

python -m pip install pillow

Usage

python ./icat ./screenshot/icat1.PNG
python ./icat -m h ./screenshot/icat1.PNG
python ./icat -s 100 ./screenshot/icat1.PNG
python ./icat -d 8 -t ./screenshot/icat1.PNG

Options

  • -s, --size: Set the output width in characters.
  • -m, --mode: Fit to terminal width (w) or height (h).
  • -d, --depth: Choose 8 or 256 color output.
  • -t: Use foreground text output (#) instead of colored blocks.
  • -f, --file: Provide the image path as an option instead of a positional argument.

Platform notes

  • Windows: run with python .\icat <image>.
  • Linux/macOS: run with python ./icat <image> or install via a wrapper script if desired.
  • argparse is part of the Python standard library and does not need a separate install.
  • curses is optional. When it is unavailable, icat falls back to shutil.get_terminal_size().

Development

Run the regression tests with:

python -m unittest discover -s tests

Screenshots

icat1 icat2 icat3

License

MIT License

About

draw image on terminal by ANSI Escape codes.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages