Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 2.05 KB

File metadata and controls

81 lines (54 loc) · 2.05 KB

Sketch to Motion Preview

Sketch to Motion

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

  • Image → Sketch → SVG → Animated MP4
  • Adjustable animation parameters:
    • Animation duration (seconds)
    • Subpath delay ratio (fractional delay between subpaths)
    • Scale factor (zoom in/out)
    • Drawing style (linear, smooth, there_and_back, wiggle)
  • High-quality vector rendering powered by Manim
  • Automatic last-frame prepend for a smooth intro
  • Simple Gradio web interface

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:

  • Windows: Download from official site and add bin folder to PATH
  • macOS: brew install ffmpeg
  • Linux: sudo apt install ffmpeg or use your package manager

Usage

Launch the Gradio app

python app.py

Access the app at:

http://127.0.0.1:7880

3. Web interface workflow

  1. Upload a doodle/photo as the Input image.
  2. Click Generate sketch to convert it to SVG.
  3. Adjust Animation duration, Subpath delay ratio, Scale factor, and Drawing style.
  4. Click Generate video to render and preview the animation.
  5. Download the generated MP4.