About this project
sharp is a high-speed Node-API module for image processing, designed primarily to convert large images in common formats into smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF files of varying dimensions. It is built on the libvips library.
It works with all JavaScript runtimes that support Node-API v9, including Node.js (>= 20.9.0), Deno and Bun. According to the project, resizing an image is typically 4x-5x faster than the quickest ImageMagick and GraphicsMagick settings, thanks to libvips.
Beyond resizing, the module handles colour spaces, embedded ICC profiles and alpha transparency channels, and uses Lanczos resampling to preserve quality. Additional operations include rotation, extraction, compositing and gamma correction. Most modern macOS, Windows and Linux systems require no extra install or runtime dependencies.
Usage is straightforward: install via npm, import or require the module, then chain operations such as resize, autoOrient, jpeg and toFile or toBuffer. It also supports creating images from scratch, compositing SVG overlays (for example rounded corners), and streaming via pipe.
Full installation instructions, API documentation, benchmark tests and changelog are available at sharp.pixelplumbing.com. The project is licensed under Apache-2.0 and welcomes contributions through its contributor guide.
Comments
0 people shared their preference · Deer Point appears after 10 participants
Sign in to join the discussion.