https://github.com/isu-kim/pltpics
A Python script that draws pictures to Matplotlib.pyplot
https://github.com/isu-kim/pltpics
fun pyplot python
Last synced: 12 months ago
JSON representation
A Python script that draws pictures to Matplotlib.pyplot
- Host: GitHub
- URL: https://github.com/isu-kim/pltpics
- Owner: isu-kim
- License: gpl-3.0
- Created: 2022-07-11T03:41:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T16:44:40.000Z (about 3 years ago)
- Last Synced: 2025-03-25T11:21:53.849Z (about 1 year ago)
- Topics: fun, pyplot, python
- Language: Jupyter Notebook
- Homepage:
- Size: 8.94 MB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PltPics
A simple script that draws picture into `matplotlib.pyplot` using bezier curves.
## Special Thanks To
kevinjycui for https://github.com/kevinjycui/DesmosBezierRenderer
## Installation
### Linux
1. Git clone this repository
2. `sudo apt-get install ffmpeg`
3. `sudo apt update`
4. `sudo apt install git python3-dev python3-pip build-essential libagg-dev libpotrace-dev pkg-config`
5. `pip install -r requirements.txt`
### Mac
1. Git clone this repository
2. `brew install ffmpeg` (or `brew` like manager)
3. `brew install potrace`
4. `brew install pkg-config`
5. `brew install libagg`
6. `pip install -r requirements.txt`
## Using Program
### `ipynb_version`
1. Visit directory `ipynb_version`
2. `jupyter notebook`
3. `./ipynb_version/DrawImage.ipynb` is for drawing images.
4. `./ipynb_version/ProcessVideo.ipynb` is for processing videos.
### `python_version`
1. Visit directory `python_version`
2. `python run_me.py`
3. For arguments, please check [here](https://github.com/gooday2die/PltPics/tree/main/python_version)
## Features
### Photo to Graph
*My profile image converted*

### Video to Graphs
*Noot Noot Meme converted*
https://user-images.githubusercontent.com/49092508/178650966-927320a6-060f-4e28-b119-0f61f53dd966.mp4
## How is this possible?
1. Extract frames of video by [ffmpeg](https://ffmpeg.org)
1. Convert image to vector images using [pypotrace](https://pypi.org/project/pypotrace/).
2. Represent those contours using Bezier curves.
3. Use `matplotlib.pyplot` to draw Bezier curves using some features.
4. Save those `pyplot`s into images.
5. Use [ffmpeg](https://ffmpeg.org) to turn those images into video.