Sketch2Motion README

The project's README from github.com/leeyeel/Sketch2Motion. As one markdown file: README.md.

Sketch to Motion Preview

Sketch to Motion

English | 简体中文

Colorful Version Demo

Input image Colorful drawing animation

Generate it with the color pipeline:

python sketch2svg_color.py input.png 16
python render_color.py input_color.svg --duration 5.0 --delay 0.05 --scale 3.55 --output-file output

The color pipeline quantizes the image into up to 16 colors, traces each color layer separately with potrace, and renders a colored drawing animation with Manim. Generated SVGs include their own background color, so they can be moved or shared without a companion file.

Convert a static image into a smooth drawing animation using Manim.

This project takes a doodle, photo, or sketch, converts it into an SVG vector graphic, and renders it into an animated MP4 video with Manim.
It also prepends the last frame to the start of the video, creating a short pause for a more polished look.


Features


Installation

1. Clone this repository

git clone https://github.com/yourusername/sketch-to-motion.git
cd Sketch2Motion

2. Install Python dependencies

Make sure you have Python 3.9+ installed.

pip install -r requirements.txt

Key dependencies:

Install Manim:

Installing Manim

Install ffmpeg:

Install Potrace:


Usage

Launch the Gradio app

python app.py

Access the app at:

http://127.0.0.1:7880

3. Web interface workflow

  1. Use the Language / 语言 selector to switch between English and Chinese.
  2. Upload a doodle/photo as the Input image. Enable Preserve colors to use the color pipeline and choose its palette size.
  3. Click Generate sketch to convert it to SVG.
  4. Adjust Animation duration, Subpath delay ratio, Scale factor, and Drawing style.
  5. Choose the Video format (landscape is selected by default), then click Generate video to render and preview the animation.
  6. Download the generated MP4.

Sketch2Motion (leeyeel/Sketch2Motion)

Searching Database…

What is this?Sketch2Motion converts a photo, doodle, or sketch into an animated drawing-style MP4 video, as if someone were drawing it by hand.
Is this a library I import or a standalone app?It is a standalone tool with a Gradio web interface you run locally; it is not meant to be imported as a library.
How do I get it running?Clone the repo, install Python dependencies, then launch the Gradio app and open it in your browser.
What do I need installed besides Python?You need Python 3.9+, plus Gradio and Manim as Python packages, and ffmpeg and Potrace available in your system PATH for rendering and tracing.
Any install pitfalls to watch for?ffmpeg and Potrace must be separately installed and added to PATH (not pulled in automatically via pip), which is a common source of setup failures on Windows.
Who would use this?Artists, hobbyists, or content creators who want to turn a static drawing or photo into a shareable 'being drawn' animation without manual vector animation work.
Does it work on Windows, macOS, and Linux?Yes, the README gives install instructions for ffmpeg and Potrace on Windows, macOS, and Linux.
Can I keep the original colors in the animation?Yes, there is an optional color-preserving pipeline that quantizes the image into up to 16 colors, traces each color layer with Potrace separately, and renders a colored drawing animation.
What animation styles and formats can I choose?You can adjust duration, subpath delay ratio, zoom scale, and pick a drawing style (linear, smooth, thereandback, wiggle), and render in landscape 16:9 or portrait 9:16.
What is the point of prepending the last frame?The tool automatically adds the final drawn frame at the start of the video, creating a brief pause that gives the animation a more polished intro.
What does the output actually look like technically?Images are traced into SVG vector graphics (with embedded background color) and then rendered into an MP4 using Manim's animation engine.
Creator
leeyeel
Size
5.3 MB
Stars
381
Updated
CommitAug 26
Age
1y
Commits · 90 Days