https://github.com/derricw/asciisciit
ASCII Art, Video, and Plotting Toolbox
https://github.com/derricw/asciisciit
ascii ascii-art gif python terminal-based webcam
Last synced: 6 months ago
JSON representation
ASCII Art, Video, and Plotting Toolbox
- Host: GitHub
- URL: https://github.com/derricw/asciisciit
- Owner: derricw
- License: mit
- Created: 2014-08-15T04:00:15.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-07-31T01:43:46.000Z (about 4 years ago)
- Last Synced: 2024-04-21T11:16:19.363Z (over 1 year ago)
- Topics: ascii, ascii-art, gif, python, terminal-based, webcam
- Language: Python
- Size: 93.8 KB
- Stars: 84
- Watchers: 10
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
asciisciit
===========
## ASCII Art, Video, and Plotting Toolbox
Ever wanted to convert gifs to text and then back into gifs again?
Ever wanted to stream your webcam into your terminal as text?
Me neither.
But now I can!

## Installation
*Should* work with py2 or py3, on both Linux and Windows.
Install with pip to make sure you get the dependencies.
$ git clone https://github.com/derricw/asciisciit.git
$ cd asciisciit
$ pip install .
You can also install from pypi.
$ pip install asciisciit
## Use
#### Examples to run!
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
You can even use URLs.
$ asciit https://media.giphy.com/media/bn0zlGb4LOyo8/giphy.gif cage.gif --e -s 0.6 -f 8

### Using the module
#### Images
>>> from asciisciit import AsciiImage
>>> img = AsciiImage("my_img.png", scalefactor=0.2)
>>> print(img)
>>> img.render("output.png", fontsize=8, bg_color=(20,20,20), fg_color=(255,255,255))
#### Gifs
>>> from asciisciit 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)
#### Movies
>>> from asciisciit import AsciiMovie
>>> movie = AsciiMovie("my_movie.avi", scalefactor=0.2)
>>> movie.play(fps=24.0)
>>> movie.render("output.avi", fps=24.0, fontsize=8) # requires ffmpeg
## TODO:
1. Color
1. more/custom look up tables