Skip to main content

Vello: GPU-Accelerated 2D Vector Graphics for Python

PyPI version License Python

Vello is a high-performance, GPU compute-centric 2D vector graphics engine for Python, powered by Linebender's Vello and wgpu.

Unlike traditional CPU renderers (like Cairo or CPU Skia) or traditional GPU renderers that rely on tessellation, Vello utilizes modern GPU Compute Shaders to perform sorting, path clipping, and antialiased rasterization in parallel on your graphics card.


✨ Features

  • ⚡ Pure GPU Compute Acceleration: Path flattening, clipping, and rasterization run completely on GPU Compute Shaders.
  • 🎨 Pythonic Canvas API: An intuitive, HTML5 Canvas-like API designed specifically for Python developers.
  • 🚀 Zero-Copy NumPy Integration: Stream rendered frames directly into NumPy (H, W, 4) uint8 arrays without copying memory.
  • ⚡ Vectorized Batch Drawing: Render tens of thousands to millions of circles, rectangles, and lines in a single native GPU dispatch via NumPy arrays.
  • 🌈 Rich Shading & Gradients: Full support for Solid Colors, Linear Gradients, Radial Gradients, Angular / Conical Sweep Gradients, and Image Brushes.
  • 🎬 Built-in Animation Export: Generate smooth animated GIF sequences directly with Canvas.save_animation().
  • 📐 Vector Shapes & SVG Paths: Native support for Rectangles, Rounded Rectangles, Circles, Ellipses, Lines, Bézier Curves, and complete SVG path d="..." strings.
  • 🔤 GPU Vector Typography: High-quality TrueType/OpenType font rendering with exact subpixel glyph positioning.
  • 🎭 Compositing & Blend Modes: Full W3C blend modes (Multiply, Screen, Overlay, etc.) and compositing operations.
  • 💡 Gaussian Drop Shadows: Accelerated blurred rounded rectangles for realistic UI drop shadows.
  • 🧵 Non-blocking & Thread-Safe: Releases the Python GIL during GPU execution for multi-threaded performance.
  • 🐧 Linux & Kaggle Ready: Fully supports headless Linux servers and Kaggle Notebooks with NVIDIA GPUs (T4, P100, A100, etc.) via Vulkan.

📦 Installation

pip install vello

🚀 Quickstart

1. Basic Drawing & PNG Export

import vello

# Create canvas with background color
canvas = vello.Canvas(800, 600, background="white")

# Fill and stroke shapes with CSS colors, hex, or RGB tuples
canvas.fill_circle(cx=400, cy=300, radius=120, fill="royalblue")
canvas.stroke_circle(cx=400, cy=300, radius=120, stroke="crimson", stroke_width=6.0)

# Draw rounded rectangle with GPU drop shadow
canvas.draw_shadow(x=50, y=50, width=200, height=100, radius=16, blur=20, color="#00000044")
canvas.fill_rounded_rect(x=50, y=50, width=200, height=100, radius=16, fill="#2ecc71")

# Draw an SVG path
canvas.fill_path("M 500 100 L 550 200 L 450 200 Z", fill="gold")

# Save directly to image
canvas.save("output.png")

2. High-Performance NumPy & Video / Game Pipelines

import vello

canvas = vello.Canvas(1920, 1080, background="black")

# Draw vector elements
canvas.fill_circle(960, 540, 200, fill="coral")

# Get a NumPy array with zero-copy buffer mapping (shape: 1080, 1920, 4)
frame = canvas.to_numpy()
print(frame.shape, frame.dtype)  # (1080, 1920, 4) uint8

3. Linear & Radial Gradients

import vello

canvas = vello.Canvas(400, 400, background="black")

# Linear gradient
gradient = vello.LinearGradient(
    start=(0, 0),
    end=(400, 400),
    stops=[
        vello.ColorStop(0.0, vello.Color.from_name("red")),
        vello.ColorStop(0.5, vello.Color.from_name("yellow")),
        vello.ColorStop(1.0, vello.Color.from_name("blue")),
    ]
)
canvas.fill_rect(0, 0, 400, 400, fill=gradient)
canvas.save("gradient.png")

4. Transformations & Layer Blending

import vello

canvas = vello.Canvas(500, 500, background="white")

# Context manager for local coordinate transforms
with canvas.transform(translate=(250, 250), rotate_deg=45):
    canvas.fill_rect(-50, -50, 100, 100, fill="teal")

# Blending and opacity layers
with canvas.layer(alpha=0.8, blend_mode="multiply"):
    canvas.fill_circle(200, 200, 80, fill="cyan")
    canvas.fill_circle(260, 200, 80, fill="magenta")

canvas.save("layers.png")

5. Vector Typography

import vello

canvas = vello.Canvas(600, 200, background="white")

# Load any TrueType or OpenType font
font = vello.Font.from_file("C:/Windows/Fonts/arial.ttf")

# Measure text bounds
width, height = font.measure_text("Vello on GPU", size=36.0)

# Draw vector text
canvas.draw_text("Vello on GPU", x=50, y=100, font=font, size=36.0, color="royalblue")
canvas.save("text.png")

6. Vectorized Batch Drawing (NumPy)

Render tens of thousands of shapes simultaneously without Python loop overhead:

import vello
import numpy as np

canvas = vello.Canvas(1000, 1000, background="black")

# 50,000 random circles [x, y, radius]
n = 50_000
data = np.zeros((n, 3), dtype=np.float32)
data[:, 0] = np.random.uniform(0, 1000, n)
data[:, 1] = np.random.uniform(0, 1000, n)
data[:, 2] = np.random.uniform(1, 5, n)

# Single native GPU call!
canvas.fill_circles_batch(data, fill="#00ffcc88")
canvas.save("batch_circles.png")

7. Animation & GIF Export

import vello
import numpy as np

frames = []
for i in range(30):
    c = vello.Canvas(300, 300, background="black")
    angle = (i / 30.0) * 360.0
    with c.transform(translate=(150, 150), rotate_deg=angle):
        c.fill_rect(-40, -40, 80, 80, fill="cyan")
    frames.append(c)

# Save smooth animated GIF
vello.Canvas.save_animation(frames, "spin.gif", fps=30)

8. Kaggle / Google Colab (Linux & NVIDIA Tesla T4)

To use vello on Kaggle (Ubuntu x86_64 with NVIDIA T4 GPU accelerator):

# 1. Install Vulkan userland library (Kaggle cell)
!apt-get update && apt-get install -y libvulkan1

# 2. Install Vello wheel or from PyPI
!pip install vello

Verify active GPU hardware & physical limits:

import vello
gpu = vello.get_gpu_info()
print("Active GPU:", gpu["name"])
print("Backend:", gpu["backend"])
print("Device Type:", gpu["device_type"])  # e.g., 'DiscreteGpu'
print("Max Buffer Binding:", gpu["max_storage_buffer_binding_size_mb"], "MB")

9. Millions of Vectors & GPU Buffer Scaling (gpu_buffer)

Vello automatically discovers and prioritizes your Discrete GPU (e.g. NVIDIA Tesla T4, RTX 3090/4090, AMD Radeon) over any integrated or software fallback adapters, maximizing the available hardware storage limits.

Furthermore, Vello features hardware-safe buffer clamping: it dynamically verifies your GPU's physical max_storage_buffer_binding_size so allocations never exceed your card's hardware capabilities.

By default, Vello allocates an ultra-safe 128 MB GPU bump allocator profile, ensuring smooth operation on low-power devices and integrated graphics.

When working with massive datasets (e.g. rendering 1,000,000+ vector shapes in 4K) on high-memory GPUs (such as an NVIDIA Tesla T4 with 16GB VRAM on Kaggle or Colab, RTX 3090/4090, or A100), you can unlock large buffer capacities:

Per-Canvas Configuration:

import vello

# Allocate a high-capacity GPU bump buffer profile:
canvas = vello.Canvas(3840, 2160, background="#050510", gpu_buffer="2GB")

# Available profiles: "128MB" (default), "256MB", "512MB", "1GB", "2GB", "4GB"

Global Configuration (e.g. at the top of a Notebook):

import vello

# Check active buffer profile
print(vello.get_gpu_buffer())  # '128MB'

# Set high-capacity profile for all canvases
vello.set_gpu_buffer("2GB")

1,000,000 Vector Circles in 4K:

import vello
import numpy as np

WIDTH, HEIGHT = 3840, 2160
N = 1_000_000

# 1. Initialize canvas with 4GB buffer
canvas = vello.Canvas(WIDTH, HEIGHT, background="#050510", gpu_buffer="4GB")

# 2. Generate 1,000,000 vector circles
data = np.zeros((N, 3), dtype=np.float32, order='C')
data[:, 0] = np.random.uniform(50, WIDTH - 50, N)
data[:, 1] = np.random.uniform(50, HEIGHT - 50, N)
data[:, 2] = np.random.uniform(2.0, 5.0, N)

# 3. Render all 1,000,000 shapes directly on GPU
canvas.fill_circles_batch(data, fill="#00ffcc")
canvas.save("galaxy_1m_4k.png")

📊 Performance

Vello parallelizes vector rendering on GPU compute shaders:

  • Instant scene builds: Adding thousands of vector commands takes just a few milliseconds.
  • Fast GPU rendering: 1080p full frame renders take ~5-10 ms on standard GPUs (~120-200 FPS).
  • GIL-free execution: Multi-threaded Python applications run concurrently without blocking.

📜 License

Licensed under either of:

at your option.

Metadata

Release files for vello 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vello 0.1.3
File Size Uploaded
vello-0.1.3.tar.gz 42.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for vello 0.1.3
File
vello-0.1.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
vello-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
vello-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
vello-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
vello-0.1.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
vello-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details

Total release size: 72.6 MB

Release files / vello-0.1.3.tar.gz

Download URL vello-0.1.3.tar.gz
Size 42.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b91a4f4b375914502480b758504ae82bf13d2ca6fb9c3a760924617446020754
BLAKE2b-256 checksum
How to use checksums
eed28f8bd857ba56637e16e9bb764e9995077eeff77e327b8b3953a5008a34a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / vello-0.1.3-cp313-cp313-win_amd64.whl

Download URL vello-0.1.3-cp313-cp313-win_amd64.whl
Size 7.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
817e109a3794d3456d2028c48ffb6a81e236ec0e4b824714381a1b7515f2eb55
BLAKE2b-256 checksum
How to use checksums
4b37be3f7a2745700d6e1f338cf22cb3926d849de288388fe5f4b8a51086d661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / vello-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL vello-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.7 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bfe3bd68b2b773abc05ae6d9bca29e51c859e79aed64e3646456f7a345d05ac8
BLAKE2b-256 checksum
How to use checksums
9c2c56d7ff448567707f37794a0a2447ad6ae89dd703dcc62894dccf2a999aa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / vello-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL vello-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.7 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
69e3c0bc586c4393af6eaea6d2038c78b3d2ec9e5c893942068b5c783ad7f7dd
BLAKE2b-256 checksum
How to use checksums
25f51e41a201bf1c9d450e2165aba8dc68369fa34dbdd54430838043f0278f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / vello-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL vello-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.7 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ee7a83357b5e0a13467bb1aff5b590c02d451aa798cbdc90430f641589585929
BLAKE2b-256 checksum
How to use checksums
a75dad04fcb0c6e036194cc5f0c39da8342740a3111a879709b2991ce905a3fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / vello-0.1.3-cp310-cp310-win_amd64.whl

Download URL vello-0.1.3-cp310-cp310-win_amd64.whl
Size 7.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
37c260f2031160987f67c95e8407705cb02dc4d0a7a5169ea4a6f4f9360b1b66
BLAKE2b-256 checksum
How to use checksums
f85317fa4c6cd25ba30eee2eb2fc03fa3d3601a97af018f919a16817c5b7044b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / vello-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL vello-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
644a856f293f468becdc795f33e54ea35267a20674aa5442df6cbea6453ade6f
BLAKE2b-256 checksum
How to use checksums
cbf9067524d0487b45e4c93c13759b8bf4a32e97f15f1046c3d9edc7a84df3de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release history Release notifications | RSS feed

0.1.7

7 release files

0.1.6

7 release files

0.1.5

7 release files

0.1.4

7 release files

This release

0.1.3 This release

7 release files

0.1.2

7 release files

0.1.1

7 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page