Skip to main content

GPU-accelerated image processing library for Python

Project description

PyImageCUDA 0.1.3

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

Uploaded CPython 3.13Windows x86-64

pyimagecuda-0.1.3-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.3-cp312-cp312-win_amd64.whl (498.1 kB view details)

Uploaded CPython 3.12Windows x86-64

pyimagecuda-0.1.3-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.3-cp311-cp311-win_amd64.whl (498.5 kB view details)

Uploaded CPython 3.11Windows x86-64

pyimagecuda-0.1.3-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.3-cp310-cp310-win_amd64.whl (498.4 kB view details)

Uploaded CPython 3.10Windows x86-64

pyimagecuda-0.1.3-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.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyimagecuda-0.1.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 543a5c9a03dd7f6de1bfcd9590b1e35bab89b45eb5459e679642fcc7f5a86f5c
MD5 b5bc317ef8c2be97dd5bf40e57d3235c
BLAKE2b-256 8c7a4ec7a4b553d1fc80141e75c4df07ea31957398776dab926325b9e029823a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 365c619805f5488ce378476458ad7ca807f66f8e3891b16314b3906e93086e95
MD5 ecc44948deffdd39b200f16ba590a373
BLAKE2b-256 b2cfd539523ced5e97eb0b6e75b8ddb0a12c448d471519a560ccf4ae22072dc0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyimagecuda-0.1.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bd215587ba735cadea0d94de6ae07f1874f70f42889ad45112722cfb796e6b39
MD5 9b755e2311af56c95df540894eb60931
BLAKE2b-256 95973dbd059eca79f63e0f6afaa62e0e51a2d71c84d8623625956d42f7b31172

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1cce653530cae89377f9758e2246ac32da512dc9abe6aee2d6b301644b1c5fd2
MD5 6114ed9658362d3ae0cba64375e5cffe
BLAKE2b-256 e86784cdd0093da7ab3834527a1c0ac6f9e53468f045187cc623afaeaf8c1c8c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyimagecuda-0.1.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8f79ce2820694cd551beef1357afdcf6ac80bbffb04d702811ed93f6592c68a1
MD5 e2412e4ed8356f3c9d742a223a86c903
BLAKE2b-256 062d5c3b391b4930128aca72a82a3fb3ae537bbc5365c5f56c95bd1ad4107e61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 33ff7597a3eaf806265b4da64bc4ae867ee8aae31cf6480f4035279bfeed082b
MD5 fbd5d59787f3939b41035fe7369ebff6
BLAKE2b-256 0023693fcc4e049cf289144e9918658a4a67e95f5dd9bb1f354f8ce0ad2dd6b0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyimagecuda-0.1.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 16738c9d8c617d3171b123dd87d06c234d88f35babd6c5c8442fff3ea9102e8a
MD5 e1eb06b3cceb0c1ecf33622c04bab0eb
BLAKE2b-256 1849a9af4da57a11b2664be234df9fd0e99f08ff0d980f49922436ba5e433ea5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyimagecuda-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bb6c8f1aefc0eaf488bced2ff548b6ae62b3b3da79096f43be8027b5a25b0215
MD5 23e25385e39bd50fb3f8664f13a5d61d
BLAKE2b-256 88cc4a51f0630014615a72f6581350e05d2d85605497906a7aca56a2b6992499

See more details on using hashes here.

Provenance

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