Stop struggling with libvips errors on Lambda/Alpine. lazy-image is a high-performance Node.js image engine that compiles to a single static binary. It features a Zero-Copy architecture for speed and produces 10% smaller JPEGs than Sharp by default using mozjpeg.
lazy-image is an advanced image processing engine designed for Node.js, focused on delivering smaller files with better quality and efficiency. Developed with a core in Rust and utilizing state-of-the-art compression technologies such as mozjpeg and AVIF, it ensures a balance between performance and memory efficiency.
Benchmark results have demonstrated significant advantages in file size and processing speed:
File Size Comparison
| Format | lazy-image | Sharp (libvips + mozjpeg) | Difference |
|---|---|---|---|
| JPEG | 15,790 bytes | 17,495 bytes | -9.7% |
| WebP | 6,378 bytes | 6,362 bytes | +0.3% |
| AVIF | 5,599 bytes | 3,683 bytes | +52.0% |
Processing Speed Comparison
| Format | lazy-image | Sharp | Speed Ratio |
|---|---|---|---|
| JPEG | 242 ms | 257 ms | 1.06x faster |
| WebP | 301 ms | 233 ms | 0.77x slower |
| AVIF | 267 ms | 288 ms | 1.08x faster |
These metrics showcase how lazy-image outperforms traditional libraries in both size reduction and processing efficiency.
With a fluent API design, lazy-image facilitates straightforward image manipulation operations such as resizing, rotating, and format conversion. Here’s a simple JavaScript example for basic usage:
const { ImageEngine } = require('@alberteinshutoin/lazy-image');
const result = await ImageEngine.from('input.png')
.resize(800, null) // Resize to width 800, auto height
.rotate(90) // Rotate by 90 degrees
.toBuffer('avif', 60); // Convert to AVIF with quality 60
For comprehensive details, including advanced features and usage scenarios, refer to the full documentation.
With lazy-image, manage images on your Node.js applications more effectively—achieve optimized sizes and superior quality seamlessly.
No comments yet.
Sign in to be the first to comment.