Skip to content

Open source command-line interface program to convert images into Matplotlib graph

License

Notifications You must be signed in to change notification settings

dwang312/MediaGrapher

 
 

Repository files navigation

MediaGrapher

Open-source command-line interface program to convert images and videos into Matplotlib graph. Uses Canny edge detection algorithm and Potrace edge detection to graph Bezier curves on Matplotlib graph.

Setup

NOTE: This program only works for Python 3.10 and above.

Install system dependencies

Ubuntu

sudo apt update
sudo apt install git python3-dev python3-pip build-essential libagg-dev libpotrace-dev pkg-config ffmpeg

CentOS/RedHat

sudo yum -y groupinstall "Development Tools"
sudo yum -y install agg-devel potrace-devel python-devel

OSX

brew install libagg pkg-config potrace

For Windows instructions, please follow the instructions listed for Windows under pypotrace.

Install project dependencies

UNIX

virtualenv env
source env/bin/activate
pip install -r requirements.txt

Windows

virtualenv --python C:\Path\To\Python\python.exe env
.\env\Scripts\activate
pip install -r requirements.txt

Running the Program

Run the GUI using the following command:

python gui.py

Run the program using the following command:

python mediagrapher.py

Use the -h or --help flag to get a detailed description of the options:

python mediagrapher.py --help

Output:

usage: MediaGrapher [-h] [-o OUTPUT] [-a {Canny,Sobel}] [-t LOW HIGH] [-p threads] url

Command-line interface for graphing images and videos.

positional arguments:
  url                   URL of the image.

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output file name. (default name: output)
  -a {Canny,Sobel}, --algorithm {Canny,Sobel}
                        Edge detection algorithm. (default algorithm: Canny)
  -t LOW HIGH, --thresholds LOW HIGH
                        Thresholds for the Canny edge detection algorithm. (default: 30, 200)
  -p THREADS, --threads THREADS (range from 1 to MAX_THREADS)
                        Number of threads utilized on the CPU. (default: MAX_THREADS)

Credits

This project is heavily influenced by the following GitHub repository.

About

Open source command-line interface program to convert images into Matplotlib graph

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.0%
  • Dockerfile 3.0%