Skip to main content

GPU-accelerated image processing library for Python

Project description

PyImageCUDA 0.1.2

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, Vibrance, Hue)
  • Transform (Flip, Rotate, Crop, Zoom)
  • Filter (Gaussian Blur, Sharpen, Sepia, Invert, Threshold, Solarize, Sobel, Emboss)
  • Effect (Drop Shadow, Rounded Corners, Stroke, Vignette, Chroma Key)

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.1.2-cp313-cp313-win_amd64.whl (498.1 kB view details)

Uploaded CPython 3.13Windows x86-64

pyimagecuda-0.1.2-cp313-cp313-manylinux_2_28_x86_64.whl (907.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyimagecuda-0.1.2-cp312-cp312-win_amd64.whl (498.1 kB view details)

Uploaded CPython 3.12Windows x86-64

pyimagecuda-0.1.2-cp312-cp312-manylinux_2_28_x86_64.whl (907.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyimagecuda-0.1.2-cp311-cp311-win_amd64.whl (498.5 kB view details)

Uploaded CPython 3.11Windows x86-64

pyimagecuda-0.1.2-cp311-cp311-manylinux_2_28_x86_64.whl (906.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyimagecuda-0.1.2-cp310-cp310-win_amd64.whl (498.4 kB view details)

Uploaded CPython 3.10Windows x86-64

pyimagecuda-0.1.2-cp310-cp310-manylinux_2_28_x86_64.whl (906.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

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

File metadata

  • Download URL: pyimagecuda-0.1.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 498.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyimagecuda-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6060c215de17e879f75e52e9a82e52b00d487cf284499c58ea5b7580874ee2dd
MD5 fcaa2809bb062aac4c0c807fa87c3d8a
BLAKE2b-256 3b85a778b8fa43c7f1e0d609ea85b9cc9bbb41b0b676f7367c150b9cb9f5906d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.1.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 761e216ff0544f2b9d2fe952fd53ad93d4aa10cf38614eb01c25195d59bfb0fd
MD5 20c5897195e8113437cca870b8d7eb19
BLAKE2b-256 b1ab37c44750ef3973fd07a736184e551c3e910a2517b0e46caf865962a08839

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyimagecuda-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 498.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyimagecuda-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 471f9532ebd16c23ca7013a190919f6819c9337cce7bbf1910bfd26887f3fb2b
MD5 3e79f539de409815e1813fbd10a5ae54
BLAKE2b-256 8dbc1f636d41a54a22a020d13ee368bb90658fbee2fb0ae2c917ac5287d88f4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.1.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9bf122a29573766734172ab9d247b5f26948ad9d702184335ec02d408da3639
MD5 32c117084fdfaa62c0cd1409d2c259af
BLAKE2b-256 b1d8c79211892c5dd1851e3a90ea2de958a5cbe7877a670790410452ee25eb61

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyimagecuda-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 498.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyimagecuda-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 43272a093aa82e30b2c9938caec2f5fd514f81684623a29c3eaead8c05f8b3b4
MD5 3be3010ea0b628a1f3753ff96da089f1
BLAKE2b-256 544c5233b790d8a20324f630d364d6f11f8466a992ffa3267a2a8f29a92a53dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.1.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 875504c06671890bf9786d16654496cc780fdcc3af1e3f44c083465e11c9a203
MD5 9f8c32e015a45ae6b0db153454ae0374
BLAKE2b-256 6bf14e550fc98ccc805b3ee806049d8f8c5a250a6df30debd45e1f972070e035

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyimagecuda-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 498.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyimagecuda-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bc95962104d9e7a1a067e2fd3d599e58a7ca6f9788be201a3da6d9813f1fbd53
MD5 d4ac30d84cb67f99aed0a46ca73e68bc
BLAKE2b-256 2bd97105e34c55f26b66126453d0a1570214bf07ee4bd359bc801f56472767c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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.1.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyimagecuda-0.1.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 545b8de20279798b5df8e704b3fc8fd44b6d5659568b550c3489b6ee030cfd97
MD5 d57e895d9a3a6f17fc5a823a74f06f29
BLAKE2b-256 f9016c3e2822d7919ceb85d600108903b65fc68f5d2dec8b849ff4dcfd91df1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimagecuda-0.1.2-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