All Projects → lovell → Sharp

lovell / Sharp

Licence: apache-2.0
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.

Programming Languages

javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to Sharp

Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (-71.16%)
Mutual labels:  webp, tiff, svg, image-processing, png, jpeg, libvips
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (-97.91%)
Mutual labels:  webp, tiff, svg, image-processing, png, jpeg, libvips
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (-93.4%)
Mutual labels:  webp, image, png, jpeg, crop, resize, libvips
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (-96.39%)
Mutual labels:  webp, image-processing, image, png, jpeg, crop
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (-80.56%)
Mutual labels:  webp, image-processing, image, png, jpeg, libvips
Metadata Extractor
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 1,972 (-90.67%)
Mutual labels:  webp, tiff, png, jpeg, exif, icc
Mort
Storage and image processing server written in Go
Stars: ✭ 420 (-98.01%)
Mutual labels:  webp, image-processing, png, jpeg, resize, libvips
Pixterm
Draw images in your ANSI terminal with true color
Stars: ✭ 782 (-96.3%)
Mutual labels:  webp, tiff, image, png, jpeg
downscale
Better image downscale with canvas.
Stars: ✭ 80 (-99.62%)
Mutual labels:  resize, png, jpeg, crop, sharp
Imgproxy
Fast and secure standalone server for resizing and converting remote images
Stars: ✭ 5,688 (-73.08%)
Mutual labels:  image-processing, image, png, jpeg, libvips
Lilliput
Resize images and animated GIFs in Go
Stars: ✭ 1,690 (-92%)
Mutual labels:  webp, image, png, jpeg, crop
Selene
A C++17 image representation, processing and I/O library.
Stars: ✭ 266 (-98.74%)
Mutual labels:  tiff, image-processing, image, png, jpeg
imagecodecs
Image transformation, compression, and decompression codecs. Forked from https://pypi.org/project/imagecodecs
Stars: ✭ 56 (-99.73%)
Mutual labels:  png, jpeg, tiff, webp, avif
sail
The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software
Stars: ✭ 206 (-99.03%)
Mutual labels:  png, jpeg, tiff, webp, avif
Tiny Site
图片优化
Stars: ✭ 65 (-99.69%)
Mutual labels:  webp, image, png, jpeg
Nuxt Optimized Images
🌅🚀 Automatically optimizes images used in Nuxt.js projects (JPEG, PNG, SVG, WebP and GIF).
Stars: ✭ 717 (-96.61%)
Mutual labels:  webp, svg, image, jpeg
Photosauce
MagicScaler high-performance, high-quality image processing pipeline for .NET
Stars: ✭ 291 (-98.62%)
Mutual labels:  tiff, image-processing, png, jpeg
Optimizt
CLI image optimization tool
Stars: ✭ 594 (-97.19%)
Mutual labels:  webp, svg, png, jpeg
Imageprocessor
📷 A fluent wrapper around System.Drawing for the processing of image files.
Stars: ✭ 2,452 (-88.4%)
Mutual labels:  webp, tiff, png, jpeg
ipx
High performance, secure and easy to use image proxy based on Sharp and libvips.
Stars: ✭ 683 (-96.77%)
Mutual labels:  resize, webp, libvips, sharp

sharp

sharp logo

The typical use case for this high speed Node.js module is to convert large images in common formats to smaller, web-friendly JPEG, PNG, WebP and AVIF images of varying dimensions.

Resizing an image is typically 4x-5x faster than using the quickest ImageMagick and GraphicsMagick settings due to its use of libvips.

Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly. Lanczos resampling ensures quality is not sacrificed for speed.

As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available.

Most modern macOS, Windows and Linux systems running Node.js >= 12.13.0 do not require any additional install or runtime dependencies.

Documentation

Visit sharp.pixelplumbing.com for complete installation instructions, API documentation, benchmark tests and changelog.

Examples

npm install sharp
const sharp = require('sharp');

Callback

sharp(inputBuffer)
  .resize(320, 240)
  .toFile('output.webp', (err, info) => { ... });

Promise

sharp('input.jpg')
  .rotate()
  .resize(200)
  .jpeg({ mozjpeg: true })
  .toBuffer()
  .then( data => { ... })
  .catch( err => { ... });

Async/await

const semiTransparentRedPng = await sharp({
  create: {
    width: 48,
    height: 48,
    channels: 4,
    background: { r: 255, g: 0, b: 0, alpha: 0.5 }
  }
})
  .png()
  .toBuffer();

Stream

const roundedCorners = Buffer.from(
  '<svg><rect x="0" y="0" width="200" height="200" rx="50" ry="50"/></svg>'
);

const roundedCornerResizer =
  sharp()
    .resize(200, 200)
    .composite([{
      input: roundedCorners,
      blend: 'dest-in'
    }])
    .png();

readableStream
  .pipe(roundedCornerResizer)
  .pipe(writableStream);

Contributing

A guide for contributors covers reporting bugs, requesting features and submitting code changes.

Test Coverage Node-API v5

Licensing

Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Lovell Fuller and contributors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].