Sharp

Sharp

sharp.pixelplumbing.com

3

About this website

Sharp is a high-performance Node.js image processing module that converts large images in common formats to smaller, web-friendly JPEG, PNG, WebP, GIF, and AVIF images of varying dimensions, powered by the libvips image processing library originally created in 1989 at Birkbeck College and maintained by John Cupitt. The module is typically 4x to 5x faster than the quickest ImageMagick and GraphicsMagick settings because libvips operates on small regions of uncompressed image data held in memory at a time, taking full advantage of multiple CPU cores and L1, L2, and L3 cache hierarchy for throughput that scales with core count rather than clock speed. The module works with all JavaScript runtimes providing Node-API v9 support including Node.js version 20.9.0 and above, Deno, and Bun, with no additional install or runtime dependencies on most modern macOS, Windows, and Linux systems. Supported input formats include JPEG, PNG, WebP, GIF, AVIF, TIFF, and SVG, while output formats cover JPEG, PNG, WebP, GIF, AVIF, TIFF, and uncompressed raw pixel data. Input and output support Node.js Streams, Buffer objects, and the filesystem, with a single input Stream splittable into multiple parallel processing pipelines. The module handles colour spaces, embedded ICC profiles, and alpha transparency channels correctly, with Lanczos resampling for quality preservation during resize. Available operations include rotation, extraction and cropping, compositing with alpha blending, gamma correction, blur and sharpen, and threshold. File size optimization uses mozjpeg for JPEG and pngquant for PNG without separate imagemin processes. Deep Zoom image pyramids can be generated for tile viewers like OpenSeadragon. Everything remains non-blocking via libuv with no child processes spawned. Copyright 2013 Lovell Fuller and contributors. Apache License 2.0.

Tags & Categories

Statistics

3
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!