You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Video is processed frame-by-frame, each frame is processed as an image using PIL, first it is resized to fit in time and quality, then each pixel is replaced with ascii character of same color, choice of ASCII character is based on Luminosity of pixel which is calculated by given formula. Finally video is written to output.avi in MJPG compression
Luminosity = 0.2126 * R + 0.7152 * G + 0.0722 * B
REQUIREMENTS
using pipenv
pipenv install
Demo Video
demo.mp4
Usage/Examples
Image to ASCII (TYPE-0)
python3 image_to_ascii.py car.png 0
Original
ASCII
Image to ASCII (TYPE-1)
python3 image_to_ascii.py img.jpg 1
Original
ASCII
Video to ASCII
python3 video_to_ascii.py video.mp4
Original
ASCII
Learnings
Learned storage of image as matrix of pixels
Learned to use PIL, OpenCV for image processing
Learned to process video frame-by-frame as an image with PIL, OpenCV