High Performance
Uses libvips image processing library, 4-5 times faster than ImageMagick and GraphicsMagick
The fastest JPEG, PNG, WebP, AVIF and TIFF image manipulation module
Sharp is the fastest image processing library for Node.js, designed for modern web applications. It uses the libvips image processing library to provide excellent performance and memory efficiency.
import sharp from 'sharp';
// Resize images
await sharp('input.jpg')
.resize(300, 200)
.toFile('output.jpg');
// Convert to WebP format
await sharp('input.png')
.webp({ quality: 80 })
.toFile('output.webp');
// Create thumbnails
await sharp('input.jpg')
.resize(100, 100, { fit: 'cover' })
.jpeg({ quality: 90 })
.toFile('thumbnail.jpg');npm install sharpOr using pnpm:
pnpm add sharpCheck out the Quick Start Guide to learn how to start using Sharp, or browse the API Documentation for complete reference information.