Code Monkey home page Code Monkey logo

video-to-ascii's Introduction

Video to ASCII Converter

A python tool that allows you to convert a video into an ASCII version of the same video. The output of the program is an mp4 format video.

Requirements

  • Pillow
  • OpenCV
  • NumPy

Installation

  • Clone this repository to your local machine.
  • Install the required packages using pip install -r requirements.txt.
  • Run the program using python videToAscii.py.

Usage

First save your input video in the inputs folder, After that run the python code, you'll be asked to enter the input video's name, enter the video name only (Not inputs/filename), After that enter the desired output file name, After letting the program run, the ascii video will be saved at outputs/{filename}.

this assumes you're not looking to customize your output

Customize

Allows you to customize the output video's text color and background color. After getting asked if you want to customize the output, enter Y, you'll be asked to enter a BG color (input is color name only. i.e: white), and then the text's color (input is the color's rgb values i.e: 255,255,255)

How it works

The program works by reading each frame of the input video and converting it into a grayscale image. The grayscale image is then resized to a smaller size. Each pixel in the resized frame is then converted into an ASCII character based on its brightness value. Finally, the ASCII characters are concatenated into a single string, after that each character in the string are written onto a new frame, Making it an ascii version of the original frame, and last all frames are added up to make a new video.

Example

Here is an example of what the result might look like:

Input

killua.mp4

Output

killua.mp4

(you can check input/output example in the inputs and outputs folder if video's aren't visible for you)

video-to-ascii's People

Contributors

axelabbas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.