Skip to main content

GPU-accelerated image processing library for Python

Project description

PyImageCUDA 0.1.4

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

Uploaded CPython 3.13Windows x86-64

pyimagecuda-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl (907.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyimagecuda-0.1.4-cp312-cp312-win_amd64.whl (498.2 kB view details)

Uploaded CPython 3.12Windows x86-64

pyimagecuda-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl (907.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyimagecuda-0.1.4-cp311-cp311-win_amd64.whl (498.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pyimagecuda-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl (907.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyimagecuda-0.1.4-cp310-cp310-win_amd64.whl (498.5 kB view details)

Uploaded CPython 3.10Windows x86-64

pyimagecuda-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl (907.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

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

File metadata

  • Download URL: pyimagecuda-0.1.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 498.2 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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ebf079672dda493425086b05369a6be7bccddb7d0ff0da71f6353545fadb9e37
MD5 40f1b81c62936d3fc00b532e2f39012a
BLAKE2b-256 b10225af224571ff184badab650c9ada671852e61f3789da1dda8857404494b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 50cd95b4d0510b02f91464846484cc5aa7c264610fc3b4ab6c00fd9245e7e163
MD5 97d713f7d713ae8a1e4e59f7fb0589ce
BLAKE2b-256 3be000314027a19715933d13d3defe69d64b06e0ac5c0987071ee6f6c137d3f7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyimagecuda-0.1.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 498.2 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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e311ecedd8dbdf2f3fbb20b5ad677c9a24c8b987c69e2b43a3ca73471a06ccc9
MD5 0ca50423aac795b1fdbad4a116c28191
BLAKE2b-256 127b75ebdf3187f05aeb3765a99b6abc1348c8feef7dcd52a192307c4d743a40

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d8a51688f5ab0b5af4c124768cb655657c87b233d1e5e53637d867a92abe654
MD5 39afdba7aa1532e16a9ff00127f0ea99
BLAKE2b-256 1f9e05ea6b46b960557ea5243315a4562edb6fcb1dcb4ce698a13faa84ff09a6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyimagecuda-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 498.6 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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9de4af5f3ed5fecab5a41d5c454e60538568dfc1c459ce93d525a18de54f9833
MD5 dab2d15bfcb4cec6e6a7fa479774269b
BLAKE2b-256 42921ad340c883dc43bd662d36a7ea7b10d7768baf773a4b505512490275f1f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d3201a2ff6dbb9e165fec981afd92fac4cf0b606d0ca6b2d7812a54118a0d31
MD5 19e946377701f69c5989188871c49370
BLAKE2b-256 b33c704f9e505fac721c6e7e18109f58314118f2a48f71cf7405c8735b5440ba

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyimagecuda-0.1.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 498.5 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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c1ddc33ee006597815cc134a0431df8674ebeaa59caef33b6eac8c6686c56871
MD5 eb33704b3900987ef77645b39b6176fb
BLAKE2b-256 631aea55bb4d6e6b054542bc6fa2bda929055430fa41db9e6679bd3db1e14ddf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 783bdee06e09ae84c6aacf1ded63910103c685472e138e4f148ef12d07017390
MD5 97fac85e038fd99f0ecd373501dd7db4
BLAKE2b-256 d4534dc7ef60cbea369a5ba2706adbe5ded79283e05b3d6361d211df7357b05f

See more details on using hashes here.

Provenance

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