Changelog
All notable changes to phpmlkit/opal will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v1.0.0 - 2026-05-23
Initial release of phpmlkit/opal — a high-performance image processing library for PHP, built on libvips.
What is Opal?
Opal is an alternative to GD and Imagick. It wraps libvips through PHP's FFI extension, providing a modern, immutable, type-safe API that's 5–10× faster than GD and 50–105× faster than Imagick in real-world pipelines.
Features
- Lazy pipelines — operations are queued and optimised; execution happens only when you save or export
- Immutable API — every transform returns a new
Image, no side effects - Full format support — JPEG, PNG, WebP, AVIF, TIFF, HEIF, BMP, GIF
- ML-ready NDArray interop — export images in CHW (PyTorch) or HWC (TensorFlow) format for phpmlkit/ndarray
- Drawing & compositing — rectangles, circles, lines, text, and image overlays with blend modes — no separate graphics library needed
- 8 resampling kernels — Nearest, Linear, Cubic, Mitchell, Lanczos2, Lanczos3, Mks211, Mks213
- 8 colour spaces — RGB, RGBA, BGR, BGRA, Grayscale, Lab, HSV, CMYK
- Image metadata — EXIF, ICC profiles, resolution, page count
- Type-safe — PHP 8.2+ with strict types, enums, and immutable value objects
Installation
bash
composer require phpmlkit/opalRequirements: PHP 8.2+, ext-ffi. The libvips binary is downloaded automatically.
Credits
- libvips — the underlying image processing engine
- jcupitt/vips — PHP FFI bindings for libvips
