Display images directly in a terminal by emitting ANSI escape codes.
- Python 3.8 or later
- Pillow
- A terminal that supports ANSI color output
python -m pip install pillowpython ./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-s,--size: Set the output width in characters.-m,--mode: Fit to terminal width (w) or height (h).-d,--depth: Choose8or256color output.-t: Use foreground text output (#) instead of colored blocks.-f,--file: Provide the image path as an option instead of a positional argument.
- Windows: run with
python .\icat <image>. - Linux/macOS: run with
python ./icat <image>or install via a wrapper script if desired. argparseis part of the Python standard library and does not need a separate install.cursesis optional. When it is unavailable,icatfalls back toshutil.get_terminal_size().
Run the regression tests with:
python -m unittest discover -s testsMIT License