https://github.com/ericfrancis12/video-to-cartoon
https://github.com/ericfrancis12/video-to-cartoon
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ericfrancis12/video-to-cartoon
- Owner: EricFrancis12
- License: mit
- Created: 2023-06-14T01:23:40.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T19:06:49.000Z (10 months ago)
- Last Synced: 2025-01-14T14:25:01.969Z (5 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Video To Cartoon
A tool for applying cartoon-like effects to full videos. Written in nodejs, dependent on:
photo2cartoon (https://www.npmjs.com/package/photo2cartoon)
fluent-ffmpeg (https://www.npmjs.com/package/fluent-ffmpeg)There are quite a few options to achieve the "cartoon" effect on images, however I've yet to find a solution for entire videos. This tool works by breaking appart your video frame-by-frame, applying the "cartoon" effect to each, then putting them back together in order and adding the original audio track back in.
## Usage
### Basic Usage
Step 1: Insert a video into ./main/inputStep 2: Run $ node extract.js - This will extract all frames of the video into individual .png files, and write them to ./main/images. Note that if you have more than one file in ./main/input, it takes only the first one.
Step 3: Run $ node p2c.js - This will take all image files in ./main/images, cartoonify them, and write them to ./main/cartoon-images
Step 4: Run $ node compile.js - This will take all image files in ./main/cartoon-images, combine them into one video per the frame rate of the original video, and write it to ./main/temp. Then it adds the audio stream from the oroginal video, and writes the final output inside ./main/output
### Notes
- You can modify whether folders are cleared in ./main/settings/settings.js### Examples
See ./examples## Photo Effects
### Explanation
The opt object is passed into new cartoonization():{
blurMode: {
name,
radius
},
edgeWeakening,
resize
}------------------------------------------------------------------------
(copied and pasted from https://www.npmjs.com/package/photo2cartoon):blurMode.name:
bilateral: use bilateral filter to blur. Cost longer time.
gaussian: perform gaussian blur.
fast: perform mean-value filterresize
Resize the input image to 400px width, and scale the height accordingly.
------------------------------------------------------------------------### Examples
See ./library/settings-examples for visual examples.The naming syntax for these images refer to the opt object:
`${blurMode.name}-${blurMode.radius}-${edgeWeakening}-${resize}.png`### Settings
Modify photo effects in ./main/settings/settings.jssettings.p2c: {
names,
radii,
edgeWeakenings,
resizes
}