30
stars
312
commits
Python
primary language
Aug 25, 2026
updated
SketchKit is a Python toolkit for loading, representing, processing, and rendering digital sketches. It is designed for researchers studying sketch data and developers building sketch-based applications, with unified APIs for datasets, vectorization, stroke ordering, image generation, colorization, animation, and 3D modeling.
Documentation · Getting Started · API Reference

Sketch, Path, Curve, and Point hierarchy.Vectorizer, Orderer, Colorizer, and Modeler.SketchKit requires Python 3.12 or later and uses uv for dependency and environment management.
Install uv on macOS or Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
On Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Clone or download this repository, then install the project environment:
git clone https://github.com/CISLab-HKUST/SketchKit.git
cd SketchKit
uv sync
Verify the installation:
uv run python -c "import sketchkit; print('SketchKit is ready')"
Load a dataset, retrieve a vector sketch, and render it to a PNG:
from sketchkit.datasets import OpenSketch
from sketchkit.renderer import CairoRenderer
dataset = OpenSketch()
sketch = dataset[0]
renderer = CairoRenderer()
image = renderer.render(sketch)
image.save("rendering.png")
Save the example as quickstart.py, then run:
uv run python quickstart.py
The script creates rendering.png. On first use, the OpenSketch adapter downloads its dataset automatically. Datasets are cached under ~/.sketchkit/datasets by default; pass root=... to choose another location, or cislab_source=True to use the CIS LAB mirror where supported.
For complete pipelines covering vectorization, animation, NPR rendering, and stylization, see the Getting Started guide.
Built-in dataset adapters convert sketches to the same vector structure:
Sketch
└── Path
└── Curve
├── Start Point
├── Control Point 1
├── Control Point 2
└── End Point
A Sketch contains paths, each Path represents a continuous stroke, and each Curve is a cubic Bézier segment. Points store coordinates and can also carry pressure, thickness, color, opacity, and custom attributes.
Learn more in the representation guide.
SketchKit currently includes 14 dataset adapters:
Download behavior, source availability, metadata, and original representation vary by dataset. Check the dataset guide and its dataset-specific pages before starting a large download.
All dataset classes expose items_metadata, a pandas DataFrame for filtering by fields such as category, split, and identifier:
from sketchkit.datasets import ControlSketch
dataset = ControlSketch()
bears = dataset.items_metadata[
(dataset.items_metadata["category"] == "bear")
& (dataset.items_metadata["split"] == "validation")
]
sketches = [dataset[row.id] for _, row in bears.head(100).iterrows()]
See the dataset guide for storage, lazy loading, metadata, and dataset-specific documentation.
SketchKit organizes methods around sketches as the central representation. The table lists implementations documented in this repository; availability and setup requirements vary by implementation.
| Task | Documented implementations |
|---|---|
| Cleanup | MasterSketch |
| Vectorization | DeepVecSIG24, LineDrawer |
| Stroke ordering | Fu, LineDrawer |
| Animation | RIFE |
| Stylization | NeuralBrushstroke |
| Image to sketch | HED, PhotoSketch, SwiftSketch, AniLines |
| Sketch to image | ControlNet, Pix2Pix, T2I-Adapter, Nano Banana 2 |
| Colorization | ControlNet Lineart, ControlNet Scribble, MangaNinja |
| 3D modeling | Teddy, SENS, Seed3D |
| Non-photorealistic rendering | Suggestive Contours, Ridges and Valleys, Apparent Ridges |
Some methods require pretrained weights, a CUDA-capable GPU, external services or credentials, or additional assets. Check the corresponding page in the methods guide before use.
The rendering modules cover both 2D and 3D sketch visualization:
Sketch3D Bézier curves into one or more camera views.See the 2D renderer guide and 3D renderer guide for examples and render options.
The complete documentation is available at:
https://cislab.hkust-gz.edu.cn/projects/sketchkit/docs/
Useful entry points:
Contributions for new datasets and processing methods are welcome. The manuals describe the expected unified interfaces, metadata conventions, module layout, tests, and GitHub workflow:
Python
100.0%
30
stars
312
commits
Python
primary language
Aug 25, 2026
updated
SketchKit is a Python toolkit for loading, representing, processing, and rendering digital sketches. It is designed for researchers studying sketch data and developers building sketch-based applications, with unified APIs for datasets, vectorization, stroke ordering, image generation, colorization, animation, and 3D modeling.
Documentation · Getting Started · API Reference

Sketch, Path, Curve, and Point hierarchy.Vectorizer, Orderer, Colorizer, and Modeler.SketchKit requires Python 3.12 or later and uses uv for dependency and environment management.
Install uv on macOS or Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
On Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Clone or download this repository, then install the project environment:
git clone https://github.com/CISLab-HKUST/SketchKit.git
cd SketchKit
uv sync
Verify the installation:
uv run python -c "import sketchkit; print('SketchKit is ready')"
Load a dataset, retrieve a vector sketch, and render it to a PNG:
from sketchkit.datasets import OpenSketch
from sketchkit.renderer import CairoRenderer
dataset = OpenSketch()
sketch = dataset[0]
renderer = CairoRenderer()
image = renderer.render(sketch)
image.save("rendering.png")
Save the example as quickstart.py, then run:
uv run python quickstart.py
The script creates rendering.png. On first use, the OpenSketch adapter downloads its dataset automatically. Datasets are cached under ~/.sketchkit/datasets by default; pass root=... to choose another location, or cislab_source=True to use the CIS LAB mirror where supported.
For complete pipelines covering vectorization, animation, NPR rendering, and stylization, see the Getting Started guide.
Built-in dataset adapters convert sketches to the same vector structure:
Sketch
└── Path
└── Curve
├── Start Point
├── Control Point 1
├── Control Point 2
└── End Point
A Sketch contains paths, each Path represents a continuous stroke, and each Curve is a cubic Bézier segment. Points store coordinates and can also carry pressure, thickness, color, opacity, and custom attributes.
Learn more in the representation guide.
SketchKit currently includes 14 dataset adapters:
Download behavior, source availability, metadata, and original representation vary by dataset. Check the dataset guide and its dataset-specific pages before starting a large download.
All dataset classes expose items_metadata, a pandas DataFrame for filtering by fields such as category, split, and identifier:
from sketchkit.datasets import ControlSketch
dataset = ControlSketch()
bears = dataset.items_metadata[
(dataset.items_metadata["category"] == "bear")
& (dataset.items_metadata["split"] == "validation")
]
sketches = [dataset[row.id] for _, row in bears.head(100).iterrows()]
See the dataset guide for storage, lazy loading, metadata, and dataset-specific documentation.
SketchKit organizes methods around sketches as the central representation. The table lists implementations documented in this repository; availability and setup requirements vary by implementation.
| Task | Documented implementations |
|---|---|
| Cleanup | MasterSketch |
| Vectorization | DeepVecSIG24, LineDrawer |
| Stroke ordering | Fu, LineDrawer |
| Animation | RIFE |
| Stylization | NeuralBrushstroke |
| Image to sketch | HED, PhotoSketch, SwiftSketch, AniLines |
| Sketch to image | ControlNet, Pix2Pix, T2I-Adapter, Nano Banana 2 |
| Colorization | ControlNet Lineart, ControlNet Scribble, MangaNinja |
| 3D modeling | Teddy, SENS, Seed3D |
| Non-photorealistic rendering | Suggestive Contours, Ridges and Valleys, Apparent Ridges |
Some methods require pretrained weights, a CUDA-capable GPU, external services or credentials, or additional assets. Check the corresponding page in the methods guide before use.
The rendering modules cover both 2D and 3D sketch visualization:
Sketch3D Bézier curves into one or more camera views.See the 2D renderer guide and 3D renderer guide for examples and render options.
The complete documentation is available at:
https://cislab.hkust-gz.edu.cn/projects/sketchkit/docs/
Useful entry points:
Contributions for new datasets and processing methods are welcome. The manuals describe the expected unified interfaces, metadata conventions, module layout, tests, and GitHub workflow:
Python
100.0%