https://github.com/donno2048/unimation
simple unicode animations
https://github.com/donno2048/unimation
animation donut mandelbrot mandelbrot-fractal mandelbrot-renderer unicode unicode-art
Last synced: 8 months ago
JSON representation
simple unicode animations
- Host: GitHub
- URL: https://github.com/donno2048/unimation
- Owner: donno2048
- Created: 2020-08-09T17:16:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T16:23:55.000Z (over 3 years ago)
- Last Synced: 2025-01-06T16:48:40.916Z (9 months ago)
- Topics: animation, donut, mandelbrot, mandelbrot-fractal, mandelbrot-renderer, unicode, unicode-art
- Language: C++
- Homepage:
- Size: 10.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Those are some unicode animations, donut2.c is for Windows and donut.c is for Linux, they are not the same (and not **completely** my work)
When compiling the c files use the `-lm` flag
The cpp file is for Windows, after compiling (`g++ doublePendulum.cpp -o main`) use it like so:
```bat
rem To simply see one double pendulum
main
rem To see n double pendulums
main n
```The python file is compatible with python3 and python2 but you have to maximize to terminal when running it.
If you get `_curses.error: addwstr() returned ERR` try decreasing the font size.
To create the _badapple.txt_ for _player.py_ I used this script:
```py
try: from PIL.Image import open
except: from Image import open
from sys import stdout
from cv2 import VideoCapture, imwrite, resize
th = 127
def I2T(File):
im = open(File)
(w, h) = im.size
mim = im.convert("1")
data = list(mim.getdata())
counter = 0
field = True
for pixel in data:
if field:
if pixel > th: stdout.write("*")
else: stdout.write(" ")
counter = counter + 1
if counter >= w:
counter = 0
if field: stdout.write("\n")
field = not field
vidcap = VideoCapture('./video.mp4') # This is the video shown
success, image = vidcap.read()
while success:
imwrite(".jpg", resize(image, (144, 108), interpolation = 3))
I2T(".jpg")
success, image = vidcap.read()
print("R")
```(You need to `pip3 install opencv-python Pillow` in order to do that)
(on Linux you may need to run `sudo apt-get install ffmpeg libsm6 libxext6 -y` to use `opencv`)
I used this script like so:
```sh
python3 main.py > badapple.txt
```