Sourcify
Effortlessly find and manage open-source dependencies for your projects.

High-performance Node.js image processing for converting large images to web-friendly formats.

sharp is a high-speed Node-API module leveraging the libvips image processing library. It excels at converting large images to smaller, web-friendly formats like JPEG, PNG, WebP, GIF, and AVIF. Designed for Node.js >= 18.17.0, Deno, and Bun, sharp is significantly faster than ImageMagick and GraphicsMagick, achieving 4x-5x speed improvements due to libvips' efficient processing. It correctly handles color spaces, embedded ICC profiles, and alpha transparency. Operations include resizing, rotation, extraction, compositing, and gamma correction. Input can be streams, Buffer objects, or filesystem paths, with support for splitting a single input stream into multiple processing pipelines. Deep Zoom image pyramids can also be generated. It optimizes JPEG and PNG file sizes using mozjpeg and pngquant respectively, and animated GIFs using custom methods, eliminating the need for separate command-line tools.
sharp is a high-speed Node-API module leveraging the libvips image processing library.
Explore all tools that specialize in convert image formats. This domain focus ensures sharp delivers optimized results for this specific requirement.
Explore all tools that specialize in optimize images. This domain focus ensures sharp delivers optimized results for this specific requirement.
Explore all tools that specialize in apply image filters. This domain focus ensures sharp delivers optimized results for this specific requirement.
Explore all tools that specialize in image resizing. This domain focus ensures sharp delivers optimized results for this specific requirement.
Utilizes libvips, processing only small regions of uncompressed image data at a time, leveraging multiple CPU cores and L1/L2/L3 cache.
Supports converting between various image formats, including JPEG, PNG, WebP, GIF, AVIF, and TIFF.
Uses mozjpeg and pngquant to optimize JPEG and PNG file sizes, respectively. Optimizes Huffman tables for JPEG output and optimizes animated GIF output.
Supports processing images directly from streams, Buffer objects, or the filesystem, allowing for flexible input and output options.
Generates Deep Zoom image pyramids suitable for use with slippy map tile viewers like OpenSeadragon.
Correctly handles color spaces, embedded ICC profiles, and alpha transparency channels.
Install sharp using npm: `npm install sharp`
Import the sharp module in your Node.js script: `const sharp = require('sharp');`
Load an image from a file, buffer, or stream: `sharp('input.jpg')...`
Apply desired transformations like resizing, rotating, or converting.
Save the processed image to a file or output stream: `.toFile('output.png')` or `.toBuffer()`
Handle errors and exceptions using Promises or async/await.
Deploy your Node.js application to a server environment.
All Set
Ready to go
Verified feedback from other users.
"Sharp is highly regarded for its speed, efficiency, and comprehensive feature set in image processing."
Post questions, share tips, and help other users.
Effortlessly find and manage open-source dependencies for your projects.

End-to-end typesafe APIs made easy.

Page speed monitoring with Lighthouse, focusing on user experience metrics and data visualization.

Topcoder is a pioneer in crowdsourcing, connecting businesses with a global talent network to solve technical challenges.

Explore millions of Discord Bots and Discord Apps.

Build internal tools 10x faster with an open-source low-code platform.

Open-source RAG evaluation tool for assessing accuracy, context quality, and latency of RAG systems.

AI-powered synthetic data generation for software and AI development, ensuring compliance and accelerating engineering velocity.