npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zieka-tools/pxl

v0.2.0

Published

GPU-accelerated image processing CLI tool

Readme

PXL - GPU-Accelerated Image Processing Tool

A high-performance command-line image processing tool written in Zig with GPU acceleration support.

Features

Implemented

  • Fast CPU-based image resizing with bilinear interpolation
  • Support for multiple image formats (JPEG, PNG, PPM, PGM) via stb_image
  • Batch processing of multiple images
  • Aspect ratio preservation
  • Comprehensive test suite (unit, integration, performance)
  • Performance benchmarks showing ~860 MP/s for 4K images on CPU

🚧 In Progress

  • CUDA GPU acceleration (kernel implemented, integration pending)
  • OpenCL support (kernel implemented, runtime integration pending)

Performance

CPU Performance (Apple Silicon M-series):

  • Small images (100x100 → 50x50): ~14 µs
  • HD images (1920x1080 → 1280x720): ~3.7 ms
  • 4K images (3840x2160 → 1920x1080): ~9.7 ms
  • Batch processing: ~1,720 images/second (800x600 → 400x300)

Installation

Prerequisites

  • Zig 0.14.0 or later
  • C compiler (for stb_image dependencies)
  • (Optional) ImageMagick for test image generation
# macOS
brew install zig

# Linux (Ubuntu/Debian)
snap install zig --classic
# or
wget https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz
tar -xf zig-linux-x86_64-0.14.0.tar.xz
export PATH=$PATH:$(pwd)/zig-linux-x86_64-0.14.0

# Windows
winget install zig.zig

Building from Source

# Clone the repository
git clone https://github.com/yourusername/pxl.git
cd pxl

# Build the project
zig build

# Build with optimizations
zig build -Doptimize=ReleaseFast

# Build as a library
zig build  # Creates both executable and library

# Install to system (optional)
zig build install --prefix /usr/local

Running Tests

# Run all tests
zig build test

# Run benchmarks
zig build bench

# Run integration tests
zig build test-integration

# Run comprehensive test suite
./test_all_features.sh

Usage

Basic Resize

pxl resize -w 800 -h 600 input.jpg -o output.jpg

Maintain Aspect Ratio

pxl resize -w 1920 --keep-aspect photo.png -o resized.png

Batch Processing

pxl resize -w 200 -h 200 *.jpg -o ./thumbnails/

Force CPU Processing

pxl resize --cpu -w 1024 -h 768 image.png

Architecture

pxl/
├── src/
│   ├── main.zig           # CLI entry point
│   ├── cli.zig            # Argument parsing
│   ├── commands/
│   │   └── resize.zig     # Resize command implementation
│   ├── cpu/
│   │   └── resize.zig     # CPU bilinear interpolation
│   ├── gpu/
│   │   ├── cuda.zig       # CUDA wrapper
│   │   ├── opencl.zig     # OpenCL wrapper
│   │   ├── detector.zig   # GPU detection
│   │   ├── resize_kernel.cu   # CUDA kernel
│   │   └── resize_kernel.cl   # OpenCL kernel
│   └── image/
│       ├── image.zig      # Image data structure
│       ├── loader.zig     # Image loading (stb_image)
│       └── writer.zig     # Image saving
└── test/
    ├── unit/              # Unit tests
    ├── integration/       # Integration tests
    └── performance/       # Benchmarks

Development

Test-Driven Development

The project follows TDD principles with comprehensive test coverage:

  • Unit tests for all core components
  • Integration tests for end-to-end workflows
  • Performance benchmarks with targets

Adding New Features

  1. Write tests first (TDD)
  2. Implement feature to pass tests
  3. Run benchmarks to ensure performance
  4. Update documentation

GPU Acceleration

CUDA Support

  • Kernel implemented for NVIDIA GPUs
  • Provides 10-100x speedup for batch operations
  • Automatic fallback to CPU when unavailable

OpenCL Support

  • Cross-platform GPU support
  • Works with AMD, Intel, and other GPUs
  • Kernel implemented, runtime integration in progress

Future Enhancements

  • [ ] Metal support for macOS
  • [ ] Additional image operations (blur, sharpen, rotate)
  • [ ] Video processing support
  • [ ] Distributed processing for large batches
  • [ ] WebAssembly build for browser usage

License

MIT

Contributing

Contributions welcome! Please ensure:

  1. All tests pass (zig build test)
  2. Benchmarks show no regression (zig build bench)
  3. Code follows Zig style guidelines
  4. New features include tests