Skip to main content

GPU-accelerated image processing library for Python

Project description

PyImageCUDA 0.0.10

PyPI version Build Status Python Platform Tests NVIDIA

GPU-accelerated image compositing for Python.

PyImageCUDA is built for image composition, not computer vision. It provides GPU tools to create, modify, and blend images, rather than analyze or recognize objects within them.

Quick Example

Demo
from pyimagecuda import Image, Fill, Effect, Blend, Transform, save

with Image(1024, 1024) as bg:
    Fill.color(bg, (0, 1, 0.8, 1))
    with Image(512, 512) as card:
        Fill.gradient(card, (1, 0, 0, 1), (0, 0, 1, 1), 'radial')
        Effect.rounded_corners(card, 50)

        with Effect.stroke(card, 10, (1, 1, 1, 1)) as stroked:
            with Effect.drop_shadow(stroked, blur=50, color=(0, 0, 0, 1)) as shadowed:
                with Transform.rotate(shadowed, 45) as rotated:
                    Blend.normal(bg, rotated, anchor='center')

    save(bg, 'output.png')

Key Features

  • Zero Dependencies: No CUDA Toolkit, Visual Studio, or complex compilers needed. Is Plug & Play on both Windows and Linux.
  • Ultra-lightweight: library weighs ~1 MB.
  • Studio Quality: 32-bit floating-point precision (float32) to prevent color banding.
  • Advanced Memory Control: Reuse GPU buffers across operations and resize without reallocation—critical for video processing and batch workflows.
  • OpenGL Integration: Direct GPU-to-GPU display for real-time preview widgets.
  • API Simplicity: Intuitive, Pythonic API designed for ease of use.

Use Cases

  • Generative Art: Create thousands of unique variations in seconds.
  • Motion Graphics: Process video frames or generate effects in real-time.
  • Image Compositing: Complex multi-layer designs with GPU-accelerated effects.
  • Node Editors & Real-time Tools: Build responsive image editors with instant preview.
  • Game Development: Procedural UI assets, icons, and sprite generation.
  • Marketing Automation: Mass-produce personalized graphics from templates.
  • Data Augmentation: High-speed batch transformations for ML datasets.

PyImageCUDA Ecosystem

This library is the foundation. For visual workflows:

PyImageCUDA Studio

  • Node-based image compositor with real-time preview
  • Design templates visually, automate with Python
  • 40+ nodes: generators, effects, filters, transforms
  • Headless batch processing API
pip install pyimagecuda-studio

Installation

Installation

pip install pyimagecuda

Note: pyvips is the only mandatory dependency (installed automatically). It is used strictly for robust file I/O (JPG, PNG, WEBP...) and high-quality Text rendering on the CPU.

Documentation

Core Concepts

Operations

  • Fill (Solid colors, Gradients, Checkerboard, Grid, Stripes, Dots, Circle, Ngon, Noise, Perlin)
  • Text (Rich typography, system fonts, HTML-like markup, letter spacing...)
  • Blend (Normal, Multiply, Screen, Add, Overlay, Soft Light, Hard Light, Mask)
  • Resize (Nearest, Bilinear, Bicubic, Lanczos)
  • Adjust (Brightness, Contrast, Saturation, Gamma, Opacity)
  • Transform (Flip, Rotate, Crop)
  • Filter (Gaussian Blur, Sharpen, Sepia, Invert, Threshold, Solarize, Sobel, Emboss)
  • Effect (Drop Shadow, Rounded Corners, Stroke, Vignette)

Performance

PyImageCUDA shows significant speedups for GPU-friendly operations like blending, filtering, and transformations. Performance varies by operation complexity and workflow:

  • Complex operations (blur, blend, rotate) see 10-260x improvements
  • Simple operations (flip, crop) see 3-20x improvements
  • Real-world pipelines with file I/O typically see 1.5-2.5x speedups

Results depend on your hardware, batch size, and whether you reuse GPU buffers.

→ View Detailed Benchmarks

Requirements

  • OS:
    • Windows 10 or 11 (64-bit).
    • Linux: Any modern distribution (Ubuntu, Fedora, Debian, Arch, WSL2, etc.).
  • GPU: NVIDIA GPU (Maxwell architecture / GTX 900 series or newer).
  • Drivers: Standard NVIDIA Drivers installed.

NOT REQUIRED: Visual Studio, CUDA Toolkit, or Conda.

Linux Compatibility & Troubleshooting

PyImageCUDA is currently tested primarily on Ubuntu LTS releases with up-to-date NVIDIA drivers.

If you encounter the following error on Linux:

RuntimeError: Kernel launch failed: the provided PTX was compiled with an unsupported toolchain.

Solution: This indicates your installed NVIDIA drivers are too old to execute the kernels included in the library. Please update your NVIDIA drivers to the latest version available for your distribution (Proprietary drivers recommended).

We are actively investigating ways to broaden compatibility for older drivers and legacy Linux distributions in future releases.

Tests

pytest tests/tests.py

Contributing

Contributions welcome! Open issues or submit PRs

License

MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyimagecuda-0.0.10-cp313-cp313-win_amd64.whl (236.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pyimagecuda-0.0.10-cp313-cp313-manylinux_2_28_x86_64.whl (643.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyimagecuda-0.0.10-cp312-cp312-win_amd64.whl (236.5 kB view details)

Uploaded CPython 3.12Windows x86-64

pyimagecuda-0.0.10-cp312-cp312-manylinux_2_28_x86_64.whl (643.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyimagecuda-0.0.10-cp311-cp311-win_amd64.whl (236.8 kB view details)

Uploaded CPython 3.11Windows x86-64

pyimagecuda-0.0.10-cp311-cp311-manylinux_2_28_x86_64.whl (643.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyimagecuda-0.0.10-cp310-cp310-win_amd64.whl (236.8 kB view details)

Uploaded CPython 3.10Windows x86-64

pyimagecuda-0.0.10-cp310-cp310-manylinux_2_28_x86_64.whl (643.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

Details for the file pyimagecuda-0.0.10-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ffbb15f31d9907e24c4408a56fed2755ebe185710899a380217eafdc4b53cdfa
MD5 8757caa0889c71a745f10592c2a9b6fa
BLAKE2b-256 152ee1a5cab23700d5f325c15e5b4aff87af402c0d4e3cdf73d412dfce545b16

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp313-cp313-win_amd64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f33bb55a9ffc1671bd4d9be0aaa2c9240a87c2b65506260ba77431fa73341bc5
MD5 7a525015872a75fb3d6fafd368785230
BLAKE2b-256 8787373147048aef873251cd0f7dfdc9a8c905b742e5188fa0af8f66714df387

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6f029101286781f2cc5e706aa92f4916409b1ee99ba28a97813810253cca9f94
MD5 b2b714957329d15ac86938459a6aa54d
BLAKE2b-256 62089bcbc8bd4b73df6085daeb81e4102389e8c25b70a176126f435e482605a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp312-cp312-win_amd64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b8cd97396bec89a40b597a8c7a04eaf900538eb09b0b335415d704f7260cbbeb
MD5 2d90d8a49f5a8d3dc0e9cc5532b79b0c
BLAKE2b-256 22d636e2768572bd91fe676ab5ed44fde27c11e5fe4c2f1f0881e93dafc53dd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ffe5a19bc50b606f2cdb07babe184a36e2cdc2a3af64fa207ae0e231ee5bcc73
MD5 601f9bd28d60f6662f4c926a58ce33ec
BLAKE2b-256 f92a4019d8d2709925c010276054c1885096fd66cfbf12a5db56004b03aa67bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp311-cp311-win_amd64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 476ebd7aa2c691ac79d65d482b3ebe84f480676c4e4a8bc25866e85cbc1045ef
MD5 897f12ee979d64f649edd4c260f8bc86
BLAKE2b-256 c71b37cfa4ba9089cf27b65e5f6492e9800179a8f032ea5b6461708f42a6843b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ffc7d4c85c9cf25b7fac65b5c3b179673bf55edfa38cea99e7879703f268ff5b
MD5 904346d9b275b00600055c04c07d4bf0
BLAKE2b-256 e1548b84250ec20d3dc89c7611975c885958d25049bec56adb1554dc969f5157

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp310-cp310-win_amd64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimagecuda-0.0.10-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.0.10-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a8fe392902851f07ba09246355408b130c27e738e63cfc5e755d763ce265ebeb
MD5 f4bf422fd6f2110ba9541157c1c8e3ca
BLAKE2b-256 81c139b3a15fa4f0fc2b814f600f59a6d8d739c2498d82ed72bea1199699664a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.0.10-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build.yml on offerrall/pyimagecuda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page