Skip to main content

GPU-accelerated drawing primitives for pixtreme

Project description

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

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 circle
img = pd.circle(img, center=(256, 256), radius=100, color=(0, 255, 0), thickness=2)

# Draw rectangle
img = pd.rectangle(img, pt1=(100, 100), pt2=(300, 300), color=(255, 0, 0), thickness=3)

# Add text label
img = pd.add_label(img, text="Hello World", position=(50, 50), color=(255, 255, 255))

# Save result
px.imwrite("output.jpg", img)

API

Shape Drawing

# Circle
pd.circle(image, center, radius, color, thickness=-1)

# Rectangle
pd.rectangle(image, pt1, pt2, color, thickness=-1)

Text Rendering

# Simple text
pd.put_text(image, text, position, font_scale=1.0, color=(255, 255, 255), thickness=1)

# Text with background label
pd.add_label(image, text, position, color=(255, 255, 255), bg_color=(0, 0, 0))

Mask Generation

# Rounded mask for compositing
mask = pd.create_rounded_mask(size=(512, 512), radius=50)

License

MIT License - see LICENSE file for details.

Links

Project details


Download files

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

Source Distribution

pixtreme_draw-0.6.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

pixtreme_draw-0.6.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pixtreme_draw-0.6.0.tar.gz.

File metadata

  • Download URL: pixtreme_draw-0.6.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for pixtreme_draw-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8d35258fc0b033053ac34570ede07fa56f3fcfedfbaebd8384c97c8050231d79
MD5 61c9e7511e11de7bd6c3cda7120ee851
BLAKE2b-256 820ab0fcabf9205578f962317858718b4137193cffc6146b5de9ac2ca2e8e593

See more details on using hashes here.

File details

Details for the file pixtreme_draw-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pixtreme_draw-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7355e3c60003c93b9a67bbae35701e6c400ae7b8c6fbb60194b86c262f94d4a
MD5 5c7ff3556f3506010501de1551d45ca0
BLAKE2b-256 f5ae2b8f3d99a8747b60a280c3bb24794505d56777b4ced29f7232cec15debe7

See more details on using hashes here.

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