Skip to main content

🪶 Feather

Rust Python License: MIT SIMD Accelerated

Feather Banner

🤖 Note: This README documentation was created by AI.

Feather is a high-performance, memory-safe 2D vector graphics and image processing extension for Python, built from the ground up in Rust.

Designed as a modern, superior alternative to Pillow's (PIL.ImageDraw) rendering engine, Feather provides flawless subpixel anti-aliasing, feathered soft edges, SIMD acceleration, modern typography, native drop shadows, clipping masks, SVG rendering with resvg, animated GIFs, and seamless integration with NumPy and Pillow.


🚀 Why Feather?

Feature Pillow (PIL.ImageDraw) Feather
Anti-Aliasing ❌ Jagged, pixelated edges 🪶 Flawless subpixel anti-aliasing & soft edges
Typography & Text Layout ⚠️ Clunky bounds, no word-wrap 🪶 Subpixel fontdue engine with automatic word-wrap
Drop Shadows & Glows ❌ None (requires 15+ lines of blur hacks) 🪶 Native 1-line diffused drop shadows & glows
Clipping Masks ⚠️ Manual putalpha masks 🪶 Native context managers (clipping_circle, etc.)
Transformation Matrix ⚠️ Limited image-level transforms 🪶 State stack: rotate, scale, translate
SVG File Rendering ❌ None (requires CairoSVG + GTK DLLs) 🪶 Built-in pure Rust resvg (0 C dependencies)
Live Interactive Viewer ❌ None (only slow external Photo Viewer) 🪶 60 FPS desktop window with pan, zoom, & live pixel loupe
Modern Animation (WebP/APNG) ❌ Poor/None 🪶 68% smaller WebP & 32-bit lossless APNG
Rounded Rectangles ⚠️ Basic or broken corner radii 🪶 Smooth bezier rounded corners (rx, ry)
Gradients ❌ None (requires manual loops) 🪶 Linear & Radial Gradients with stops
Vector Paths ❌ Limited polylines 🪶 Quadratic/Cubic Beziers & SVG d Paths
Multi-Core / GIL ❌ Locks Python GIL, single-threaded 🪶 Multi-core Rayon parallelism, GIL released
Image Resizing ⚠️ Standard CPU resampling 🪶 SIMD-accelerated (AVX2/SSE4.1)
Blend Modes ⚠️ Basic alpha compositing 🪶 24+ Blend Modes (Multiply, Screen, etc.)
NumPy / Pillow Bridge ⚠️ Slow conversions 🪶 Direct zero-copy buffer interop

Pillow vs Feather Subpixel Anti-Aliasing
Left: Pillow (jagged, staircase aliasing)  •  Right: Feather (smooth subpixel anti-aliasing with radial gradients & bezier curves)


📦 Installation

Option 1: Pre-built Binary Wheel (No Rust or Compilers Needed)

Anyone on Windows can install Feather instantly using the pre-built standalone wheel:

# Install directly from the repository's releases folder:
pip install releases/feather_render-0.4.0-cp310-abi3-win_amd64.whl

(Multi-platform wheels for Linux, macOS, and Windows are also automatically built and downloadable from the GitHub Releases tab).

Option 2: Direct from GitHub via pip

pip install git+https://github.com/yourusername/feather.git

Option 3: From PyPI

pip install feather-render

Option 4: Build from Source

git clone https://github.com/yourusername/feather.git
cd feather
pip install maturin
maturin develop --release

🎨 Quickstart

1. Typography & Multi-Line Text Boxes

Feather includes built-in system font fallbacks and subpixel glyph rasterization powered by fontdue:

from feather import Canvas, Font

canvas = Canvas(800, 600, background="#11111b")

# Single line text
canvas.draw_text("⚡ Feather 0.2.0: Typography Engine", 50, 40, size=28, color="#f5c2e7")

# Multiline text box with automatic word wrapping
long_text = "Feather renders smooth vector graphics with zero C dependencies. Words wrap smoothly and gracefully."
width, height = canvas.draw_text_box(
    long_text,
    x=50, y=100, max_width=350,
    size=18, color="#cdd6f4", line_spacing=6
)

# Load any custom TTF or OTF font
custom_font = Font.load("path/to/custom_font.ttf")
canvas.draw_text("Custom Font", 50, 200, size=22, font=custom_font)

2. Native Drop Shadows & Glow Effects

Create buttery-smooth, diffused glassmorphic cards and glowing badges in a single call:

# Card with soft drop shadow
canvas.draw_drop_shadow(
    x=450, y=90, width=300, height=160,
    rx=18, blur=18.0, offset_x=0.0, offset_y=10.0,
    color="rgba(0, 0, 0, 0.5)"
)
canvas.draw_rounded_rect(450, 90, 300, 160, rx=18, fill="#1e1e2e", stroke="rgba(255, 255, 255, 0.15)", stroke_width=1.5)

# Outer glow effect on badges or buttons
canvas.draw_glow(cx=520, cy=200, radius=25, blur=20.0, color="rgba(243, 139, 168, 0.7)")
canvas.draw_circle(520, 200, radius=25, fill="#f38ba8")

3. Matrix Transformations & Clipping Masks

Crop avatars into circles, rounded rectangles, or rotate vector art effortlessly with Python context managers:

# Rotate and transform shapes
with canvas.transform_scope():
    canvas.translate(150, 420)
    canvas.rotate(degrees=25)
    canvas.draw_rect(-40, -40, 80, 80, fill="#a6e3a1")

# Circular avatar clipping mask
with canvas.clipping_circle(cx=320, cy=420, radius=55):
    canvas.draw_image(avatar_canvas, 265, 365)  # Automatically clipped to a circle!

4. Zero-Dependency SVG File Rendering (resvg)

Render entire .svg vector files or SVG XML strings directly onto your canvas at arbitrary coordinates and dimensions:

# Render SVG document string or file
svg_xml = """
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <circle cx="50" cy="50" r="40" fill="#f38ba8" stroke="#ffffff" stroke-width="4"/>
</svg>
"""
canvas.draw_svg_document(svg_xml, x=100, y=100, width=150, height=150)

# Or directly from a file:
canvas.draw_svg_file("icons/badge.svg", x=300, y=100, width=150, height=150)

5. Modern Animation Exporter (save_webp, save_apng, save_animation)

Render high-framerate multi-frame animations with full 32-bit RGBA alpha transparency and up to 70% smaller file size than GIF!

from feather import Canvas, save_animation, save_webp, save_apng, save_gif

frames = []
for i in range(30):
    frame = Canvas(400, 400, background="#0f0f17")
    angle = i * (360 / 30)
    with frame.transform_scope():
        frame.translate(200, 200)
        frame.rotate(angle)
        frame.draw_rounded_rect(-50, -50, 100, 100, rx=16, fill="#89b4fa")
    frames.append(frame)

# 🌐 Animated WebP (68% smaller than GIF, full 32-bit truecolor & alpha!)
save_webp(frames, "animation.webp", fps=30, loop_count=0, lossless=True)

# 🖼️ Animated PNG / APNG (lossless 32-bit RGBA for Discord/browsers)
save_apng(frames, "animation.png", fps=30, loop_count=0)

# 🔄 Unified Auto-Detection (detects .webp, .apng, .png, .gif automatically)
save_animation(frames, "animation.webp", fps=30)
Format Color Depth Alpha Transparency Compression Best For
WebP 32-bit Truecolor ✅ Full 8-bit Alpha ~68% smaller than GIF Web, Modern Apps
APNG 32-bit Truecolor ✅ Full 8-bit Alpha Lossless Truecolor Discord, Apple, High-DPI
GIF 8-bit (256 colors) ❌ 1-bit Binary Only Larger file size Legacy fallback

Feather Animated Radar Demo
Live 30 FPS multi-frame animation rendered directly with Feather


6. Instant Live Interactive Window (canvas.show(), show_interactive())

Instead of Pillow's image.show() that dumps a temporary BMP to Windows Photo Viewer, Feather boots a native 60 FPS desktop window:

Feather Interactive Desktop Viewer

from feather import Canvas, show_interactive

canvas = Canvas(1000, 700, background="#161922")
# ... draw anything ...

# 🖥️ Open instant interactive desktop viewer
canvas.show(title="My CAD Blueprint")

# 🎬 Or play multi-frame animations in real-time
show_interactive(frames, title="Signal Flow Simulation", fps=30)

Interactive Controls:

  • 🔍 Smooth Zoom: Scroll mouse wheel centered directly at your cursor.
  • 🖐️ Pan: Click and drag with left mouse button anywhere across the canvas.
  • 🎯 Pixel Inspector: Hover over any pixel to see exact (X, Y) coordinates and Hex/RGBA color live in the title bar HUD.
  • ⏯️ Playback: Press Space to Pause/Play, Left/Right arrow keys to step through animation frames.
  • 🔄 Reset View: Press R to re-center and fit to window.
  • 📸 Instant Snapshot: Press S to save the current frame as a PNG.
  • Exit: Press Esc or Q.

7. CAD & Electronic Schematic Rendering

Feather's subpixel anti-aliased vectors, transform matrix instancing, and SVG path parsing make it exceptionally suited for rendering high-precision CAD diagrams and electronic schematics without external software:

Feather CAD Circuit Schematic
Complete Op-Amp schematic rendered with Feather (see examples/schematic_demo.py)


8. Anti-Aliased Shapes & Gradients

from feather import Canvas, LinearGradient, RadialGradient

canvas = Canvas(800, 600, background="#11111b")

# Linear gradient
grad = LinearGradient(50, 50, 350, 250, stops=[
    (0.0, "#f38ba8"),
    (0.5, "#cba6f7"),
    (1.0, "#89b4fa")
])
canvas.draw_rounded_rect(50, 50, 300, 200, rx=24, fill=grad, stroke="#ffffff", stroke_width=2.5)

# Radial gradient
radial = RadialGradient(550, 200, 90, stops=[
    (0.0, "#a6e3a1"),
    (1.0, "rgba(166, 227, 161, 0)")
])
canvas.draw_circle(550, 200, radius=90, fill=radial, stroke="#94e2d5", stroke_width=3.0)

canvas.save("render.png")

9. SIMD Resizing & Image Filters

img = Canvas.open("photo.png")

# Ultra-fast SIMD resize (filters: 'bilinear', 'bicubic', 'lanczos3', 'nearest')
thumbnail = img.resize(256, 256, filter="lanczos3")

# Multi-threaded Gaussian Blur (GIL released)
blurred = img.blur(sigma=4.5)

# Adjust brightness and contrast
enhanced = img.adjust_contrast(1.2).adjust_brightness(1.05)
enhanced.save("enhanced.jpg", quality=95)

10. Seamless Pillow & NumPy Interop

from PIL import Image
import numpy as np
from feather import Canvas

# Pillow -> Feather
pil_img = Image.open("avatar.png")
canvas = Canvas.from_pillow(pil_img)

# Feather -> Pillow
result_pil = canvas.to_pillow()

# Feather <-> NumPy
np_array = canvas.to_numpy()  # uint8 shape (H, W, 4)
new_canvas = Canvas.from_numpy(np_array)

🏗 Architecture

  • Rasterizer Engine: Built on tiny-skia, a pure Rust port of Google's Skia software rasterizer. Features full SIMD optimizations for AVX2, SSE4.1, and ARM Neon.
  • SVG Engine: Integrated resvg for 100% pure Rust, zero-dependency SVG vector document rasterization.
  • Font Engine: Powered by fontdue for subpixel glyph coverage rasterization and text measurement.
  • Resampling Pipeline: Uses fast_image_resize for blazing-fast SIMD image convolutions.
  • Concurrency: Work-stealing thread pools powered by rayon.
  • Color Engine: Parses CSS hex, rgb, rgba, hsl, and named colors via csscolorparser.

📄 License

This project is licensed under the MIT License.


🤖 Note: This README was made with AI.

Release files for feather-render 0.4.1

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

Built distributions (wheels)

Table of built distributions (wheels) for feather-render 0.4.1
File
feather_render-0.4.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
feather_render-0.4.1-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details
feather_render-0.4.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
feather_render-0.4.1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 9.5 MB

Release files / feather_render-0.4.1-cp310-abi3-win_amd64.whl

Download URL feather_render-0.4.1-cp310-abi3-win_amd64.whl
Size 2.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b63fcdc11e62e347fe948450dbc0db02924959854bc6e2bf1f3ecd408e3a53d6
BLAKE2b-256 checksum
How to use checksums
7d8034762d47180b33b67ca99e437a522095fcce0f68fc7714b0ecfab6724ec5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / feather_render-0.4.1-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL feather_render-0.4.1-cp310-abi3-manylinux_2_34_x86_64.whl
Size 2.8 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
918025b9f5493b2a770acbff678f17240d9b3f3351461d2a55eb2754b32dbf5f
BLAKE2b-256 checksum
How to use checksums
db4cefc1cc499b958186d836a5586aeb8bdc6798c089577207660c06e3c35a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / feather_render-0.4.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL feather_render-0.4.1-cp310-abi3-macosx_11_0_arm64.whl
Size 2.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a825a16b577dc280734188ff22149b7c218c0e94c30f5a8988ea34008a08c43
BLAKE2b-256 checksum
How to use checksums
9ee029c79146a01c43eb05933c44af769f17feb99f2636b52cefea7f9df82b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / feather_render-0.4.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL feather_render-0.4.1-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6d0ffa0a18c969899439f3907837d0bfd8283418db44733fbd347de50b21e70a
BLAKE2b-256 checksum
How to use checksums
9009c56c1ed5f2600f45daa6ab847f7f6381ed1464db5fd811896a5c702db269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.3

4 release files

0.4.2

4 release files

This release

0.4.1 This release

4 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