pixtreme-draw
GPU-accelerated drawing primitives for pixtreme
Overview
pixtreme-draw provides high-performance drawing operations for rendering shapes, text, and masks directly on GPU memory.
Features
- Shape Drawing: Circles, rectangles with anti-aliasing
- Text Rendering: GPU-accelerated text with custom fonts
- Mask Generation: Rounded masks for compositing
- Zero-Copy: Direct GPU memory operations via CuPy
Installation
Requirements:
- Python >= 3.12
- CUDA Toolkit 12.x
- NVIDIA GPU with compute capability >= 6.0
pip install pixtreme-draw
Requires pixtreme-core, pixtreme-filter, and CUDA Toolkit 12.x.
Quick Start
import pixtreme_draw as pd
import pixtreme_core as px
# Read image
img = px.imread("input.jpg")
# Draw filled circle
img = pd.circle(img, center_x=256, center_y=256, radius=100, color=(0.0, 1.0, 0.0))
# Draw filled rectangle
img = pd.rectangle(img, top_left_x=100, top_left_y=100, bottom_right_x=300, bottom_right_y=300, color=(1.0, 0.0, 0.0))
# Add text label with background
img = pd.add_label(img, text="Hello World", org=(50, 50), color=(1.0, 1.0, 1.0))
# Save result
px.imwrite("output.jpg", img)
API
Shape Drawing
# Circle (filled)
pd.circle(image, center_x, center_y, radius, color=(1.0, 1.0, 1.0))
# Rectangle (filled)
pd.rectangle(image, top_left_x, top_left_y, bottom_right_x, bottom_right_y, color=(1.0, 1.0, 1.0))
Text Rendering
# Simple text
pd.put_text(image, text, org, font_face=cv2.FONT_HERSHEY_SIMPLEX, font_scale=1.0, color=(1.0, 1.0, 1.0), thickness=2)
# Text with background label
pd.add_label(image, text, org=(0, 0), font_scale=1.0, color=(1.0, 1.0, 1.0), label_color=(0.0, 0.0, 0.0))
Mask Generation
# Rounded mask for compositing
mask = pd.create_rounded_mask(dsize=(512, 512), radius_ratio=0.1, blur_size=0, sigma=1.0)
License
MIT License - see LICENSE file for details.
Links
- Repository: https://github.com/sync-dev-org/pixtreme
Metadata
Release files for pixtreme-draw 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pixtreme_draw-0.9.0.tar.gz | 13.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pixtreme_draw-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.9 kB
Release files / pixtreme_draw-0.9.0.tar.gz
| Download URL | pixtreme_draw-0.9.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcf7d9688932fe9c6cb37bf7c649c752773ea406b120cfb5d527e9426d493286
|
|
BLAKE2b-256 checksum How to use checksums |
1b7baa42cd67856feeab7ffea1234b5f0958a5f7df5a8ed134149cd0f444e138
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / pixtreme_draw-0.9.0-py3-none-any.whl
| Download URL | pixtreme_draw-0.9.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dedda6d0d2201f0891eb1d3665e36030cce98e2d3cf6bc64a9c8b5fef054638e
|
|
BLAKE2b-256 checksum How to use checksums |
5d3a8c4cc95cf7321de4b1b7e15622de7c00a77683b388bc1247d08f494eb599
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Security for pixtreme-draw 0.9.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.