/ConsoleImage

Display image in console using specified characters (OpenGL based)

Primary LanguageC++MIT LicenseMIT

ConsoleImage

Display image in console using specified characters


Build Guide

Requirements:

  • C++17 compiler
  • cmake
  • GPU supporting OpenGL >= 3.3

Only tested on Linux & Windows

Commands:

git submodule update --init --recursive
mkdir build && cd build
cmake ..
make -j4

Or (on Windows)

cmake --build . --config Release

Executable will be generated in folder bin


Command Arguments

.\show.exe -h
Usage: ConsoleImage [options] filepath

Positional arguments:
filepath        image path to display [required]

Optional arguments:
-h --help       shows help message and exits
-v --version    prints version information and exits
--verbose       show processing details [default: false]
--color         colored output [default: false]
-s --size       number of lines (size) to display (val > 0) [default: 20]
-c --chars      characters to use (dark to light) [default: {}]
-e --edge       enable edge detection and set edge color(HEX) [default: "000000"]

Demo

.\show.exe ..\assets\apple.png -s 30

demo1

.\show.exe ..\assets\monalisa.jpg -s 50

demo2

.\show.exe ..\assets\lion.jpg -s 40 -c " " -c "." -c "&"

demo3

.\show.exe ..\assets\blackhole.jpg -s 30 --color -c " "

demo4

.\show.exe ..\assets\starrynight.jpg --color -c " " -s 40 --verbose
Arguments parsed
Image loaded: ..\assets\starrynight.jpg
OpenGL context created
Image processed

demo5


Notes

Edge detection has been implemented. But it won't improve the visual. The reason is that it is done on the image that is already downscaled, so less info available. Another reason is that edge detection is not guarenteed to generate a smooth and continous outline.