Convert images and GIFs to ascii characters.
- c++20
- giflib
- boost [https://www.boost.org/doc/user-guide/getting-started.html]
- wget
- only for URLs
Make executable:
cd img2ascii
makeShow usage:
./img2asciior
./img2ascii --helpConverting an image to ascii:
./img2ascii image.pngTo convert ascii to image:
./img2ascii --ascii-to-image file.txt output.pngDownloading images requires wget to be installed. Downloading the image will prompt confirmation before downloading:
./img2ascii 'https://example.com/image.png'Tip
Args can still be used if you use URL.
Blocking out a color (like a green screen) can be used with the chroma command:
./img2ascii image.png --chroma='0,255,0'optionally use thresholds:
./img2ascii image.png --chroma='0,255,0' --chroma-threshold=0.7Alternatively, color names can be used, e.g. --chroma=green:
- green
- red
- blue
- white
- black
Large images can fill the entire terminal; the scale command can be used to prevent this:
./img2ascii image.png --scale=0.1The autoscale option can also be used to fit inside the terminal:
./img2ascii image.png --autoscaleUse colored arg to colorize ascii characters:
./img2ascii image.png --colored
Tip
This also works with GIFs.
Specify number of times to loop GIF:
./img2ascii image.gif --gif-cycles=2Specified time in seconds:
./img2ascii image.gif --gif-time=3Or loop a GIF forever (cancel with ctrl+C):
./img2ascii image.gif --gif-loopThe speed of a GIF can be changed via the gif-speed arg:
./img2ascii image.gif --gif-speed=0.5- png
- jpg
- gif
- stb_image [https://github.com/nothings/stb/]
