Ever wanted to convert gifs to text and then back into gifs again?
Ever wanted to convert movies to text and watch them in your terminal?
Ever wanted to stream your webcam into your terminal as text?
Me neither.
But now I can!
-
Pillow Get the latest version of Pillow. <=2.0.0 has issues writing gifs.
Install with:
python setup.py install
The CLI should work as long as you install using setup.py.
If not, you will need to mess with environment variables and/or symbolic links.
Convert a gif to ascii and render it back to gif in 8 point font:
$>asciit dealwithit.gif ascii_render.gif -p 8
Display webcam feed from camera 0 in a new terminal, with histogram equalization:
$>asciit -w 0 --n --e
Play a video file in a new terminal, scale to 0.15 characters per pixel, display at 24 fps:
$>asciit cats.mp4 -s 0.15 --n -f 24.0
Convert a video to ascii
>>> from asciisciit.asciiart import AsciiImage
>>> img = AsciiImage("my_img.png")
>>> print(img)
>>> img.render("output.png", fontsize=8, bg_color=(20,20,20), fg_color=(255,255,255))
>>> from asciisciit.asciiart import AsciiMovie
>>> gif = AsciiMovie("my_gif.gif", scalefactor=0.2)
>>> gif.play(fps=15.0) #play at 15 fps
>>> gif.render("ouput.gif", fps=15.0, fontsize=8)
>>> from asciisciit.asciiart import AsciiMovie
>>> movie = AsciiMovie("my_movie.avi", scalefactor=0.2)
>>> movie.play(fps=24.0)
>>> movie.render("output.avi", fps=24.0, fontsize=8)
- Sometimes gifs look really wonkey. Especially ones with superimposed text. I blame PIL.