A Python script to convert image or video into ASCII art. Basically replicating an image or video with some characters.
- Download and install Python from here
- Download and install FFmpeg from here
- Download the source code of this repository here and extract it somewhere on your drive
- Open your cmd or PowerShell and type in
pip install Pillow
pip install uni-curses
- Run the
ivscii.py
by typing inpython ivscii.py
on your command prompt followed by the arguments that you want to fill, it looks something like this:
python ivscii.py -m 2 -w 100 -e 20 pictures/cute.jpg
- Install Python using your package manager
- Install FFmpeg using your package manager
- Install git using your package manager in case you dont have one installed
- Install ncurses using your paclage manager in case you dont have one installed
- Install mpv using your package manager (if you plan to use the audio support)
- Copy and paste this script below:
pip install Pillow
pip install uni-curses
mv ivscii.py ivscii
sed -i 's| shebang|\!/usr/bin/env python|' ivscii
chmod +x ivscii
sudo cp ivscii /usr/local/bin/ivscii && cd ..
Copy and paste this script below:
pkg install ncurses
pkg install python
pip install uni-curses
pip install Pillow
pkg install ffmpeg
pkg install git
git clone https://github.com/hithere-at/ivscii.git && cd ivscii
mv ivscii.py ivscii
sed -i 's| shebang|\!/data/data/com.termux/files/usr/bin/python|' ivscii
chmod +x ivscii
cp ivscii $PREFIX/bin/ivscii && cd ..
If you plan to use audio suppport, install mpv by doing:
pkg install mpv
usage: ivscii [-h] [-w WIDTH] [-he HEIGHT_SUB] [-s SHARPNESS] [-m MODE] [-o OUTFILE]
[-a YES|NO] [-t SEC] [-v YES|NO] [-g YES|NO] [--fps FPS]
file|url
Convert video to ASCII art
positional arguments:
file|url path to the video or image
optional arguments:
-h, --help show this help message and exit
-w WIDTH change the width of the ASCII art, default value is 105
-he HEIGHT_SUB change the height of the ASCII art, default value is 32 (the
value does not define the literal height of the ASCII art)
-s SHARPNESS change the sharpness of the art, the lower the better, default
value is 4
-m MODE change the draw mode, default value is 1
-o OUTFILE draw ASCII art to a file
-a YES|NO turn on audio support for video art (very unstable), default
value is 'no'
-t SEC set audio offset for audio support, default value is 2.8
-v YES|NO add FPS cap to video art, default value is 'yes'
-g YES|NO change greyscale characters, default value is 'no'
--fps FPS change video frame rate, default value is 15
ivscii
audio support and shell interpreter for Windows is disbaled due to inavailability of Windows machine (i had to guess the step). Sorry for the inconvenience- Basically, i dont write the image to ASCII converter, i only add video support with or without audio support, and make the width and height of the art can be changed
- For the love of god, PLEASE DO NOT MAKE ANY PULL REQUEST TO THIS REPOSITORY. Its too hard to clean the code, and if you make a code refactor pull request, you are an absolute madlad
- educative.io how to turn image to ASCII