JavaScript image processing libraries

Updated Nov 2026

JavaScript image processing libraries decode image files, change their pixels, and encode the results in a new format or size. A processing pipeline reads an image, applies steps such as resizing, cropping, or color reduction, and writes the output. These libraries generate the thumbnails, product photos, and optimized web images that apps serve from upload pipelines and build steps.

Popularity

sharp has the most monthly downloads in this comparison, at 630.3M.

LibraryMonthly downloadsStarsLast releaseLicense
sharp
630.3M
32.9KSep 2026Apache-2.0
@napi-rs/canvas
197.5M
2.4KNov 2026MIT
node-canvas
43.8M
10.7KMar 2026MIT
Image Q
17.3M
168Jan 2022MIT
jimp
16.7M
14.7KApr 2026MIT
Pica
6.4M
4.2KAug 2026MIT
imagemin
4.1M
5.7KMar 2025MIT
skia-canvas
1.1M
2.6KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Transforms images through a streaming image-processing pipeline.

Downloads / mo
630.3M
Stars
32.9K
Last release
0.35.5
License
Apache-2.0

Strengths

  • Converts common web image formats. Read common image formats and produce JPEG, PNG, WebP, GIF, or AVIF.
  • Works with streams and buffers. Process image data from streams, buffers, or file paths.

Limitations

  • Repeated resizing replaces earlier settings. Use separate pipelines when the same input needs multiple resize stages.

Quickstart

From README.md
$ npm install sharp
import sharp from 'sharp';
await sharp('input.jpg').resize({width: 320}).toFile('output.webp');

@napi-rs/canvas

Draws with the Canvas 2D API in Node.js through a Skia binding with no system dependencies.

Downloads / mo
197.5M
Stars
2.4K
Last release
1.1.1
License
MIT

Strengths

  • No system libraries to install. Prebuilt Skia binaries install without Cairo or other system packages.

Limitations

  • Needs a recent glibc on Linux. Older Linux systems fail when their glibc predates the version that Skia requires.

Quickstart

From README.md
$ npm install @napi-rs/canvas
import {writeFile} from 'node:fs/promises';
import {createCanvas} from '@napi-rs/canvas';
const canvas = createCanvas(100, 100);
canvas.getContext('2d').fillRect(10, 10, 50, 50);
await writeFile('output.png', await canvas.encode('png'));

@napi-rs/canvas examples

From open-source projects on GitHub

Implements the Canvas drawing API for server-side Node.js graphics.

Downloads / mo
43.8M
Stars
10.7K
Last release
3.2.3
License
MIT

Strengths

  • Uses the familiar Canvas API. Draw through a Canvas 2D context on the server.
  • Supports registered font files. Register a font file before drawing text with that font.

Limitations

  • Unsupported platforms require native builds. Install Cairo and Pango when prebuilt binaries are unavailable.
  • Optional codecs affect image support. GIF, SVG, and JPEG support depends on the corresponding native libraries.

Quickstart

From Readme.md
$ npm install canvas
const {writeFileSync} = require('node:fs');
const {createCanvas} = require('canvas');
const canvas = createCanvas(100, 100);
canvas.getContext('2d').fillRect(10, 10, 50, 50);
writeFileSync('output.png', canvas.toBuffer('image/png'));

node-canvas examples

From open-source projects on GitHub

Reduces an image's colors to a smaller palette, with alpha support and several quantization algorithms.

Downloads / mo
17.3M
Stars
168
Last release
4.0.0
License
MIT

Strengths

  • Choice of color distance formula. Options select the formula that measures how far apart two colors are.

Limitations

  • Works on pixel containers. Images pass in and out as point containers rather than image files.

Quickstart

From image-q docs
$ npm install image-q
import {utils, buildPaletteSync} from 'image-q';
const pixels = utils.PointContainer.fromUint8Array(new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255]), 2, 1);
const palette = buildPaletteSync([pixels], {colors: 2});
console.log(palette);

Image Q examples

From open-source projects on GitHub

Loads and edits images in JavaScript for Node.js and browsers.

Downloads / mo
16.7M
Stars
14.7K
Last release
1.6.1
License
MIT

Strengths

  • Avoids native image dependencies. Use JavaScript image codecs in Node.js or browser environments.
  • Includes bitmap-font text drawing. Load a bitmap font and print text into an image.

Limitations

  • Large images increase memory use. JavaScript codecs allocate substantial memory and prioritize portability over performance.
  • Version upgrades change method arguments. Migrate positional image operations to v1 options objects.

Quickstart

From getting-started.mdx
$ npm install jimp
import {Jimp} from 'jimp';
const image = await Jimp.read('input.png');
image.resize({w: 320});
await image.write('output.png');

jimp examples

From open-source projects on GitHub

Resizes images in the browser without pixelation.

Downloads / mo
6.4M
Stars
4.2K
Last release
10.0.3
License
MIT

Strengths

  • Shrinks images before upload. Resizing in the browser reduces the upload size of large images.

Limitations

  • Remote images need CORS headers. Images from another domain load only with an Access-Control-Allow-Origin header.

Quickstart

From README.md
$ npm install pica
import pica from 'pica';
const source = new Image();
source.src = 'input.jpg';
await source.decode();
const target = document.createElement('canvas');
target.width = 100;
target.height = 100;
await pica().resize(source, target);
document.body.append(target);

Pica examples

From open-source projects on GitHub

Minifies image files through optimizer plugins.

Downloads / mo
4.1M
Stars
5.7K
Last release
9.0.1
License
MIT

Strengths

  • Optimizes in-memory image data. The buffer method optimizes image data that is already in memory.

Limitations

  • Writes files only with a destination. Results stay in memory unless the destination option names a folder.

Quickstart

From readme.md
$ npm install imagemin imagemin-jpegtran
import imagemin from 'imagemin';
import imageminJpegtran from 'imagemin-jpegtran';
const files = await imagemin(['images/*.jpg'], {destination: 'build/images', plugins: [imageminJpegtran()]});
console.log(files);

imagemin examples

From open-source projects on GitHub

Renders the Canvas API in Node.js through Skia and exports vector or bitmap images.

Downloads / mo
1.1M
Stars
2.6K
Last release
4.0.1
License
MIT

Strengths

  • Vector and bitmap output. A canvas saves as a PDF, SVG, JPEG, PNG, or WEBP file.
  • Multi-page PDF output. Several pages on one canvas export as one PDF or as a sequence of image files.

Quickstart

From README.md
$ npm install skia-canvas
import {Canvas} from 'skia-canvas';
const canvas = new Canvas(100, 100);
canvas.getContext('2d').fillRect(10, 10, 50, 50);
await canvas.toFile('output.png');

skia-canvas examples

From open-source projects on GitHub

FAQ

sharp is a Node.js image processing module that converts large images in common formats to smaller JPEG, PNG, WebP, GIF, and AVIF files. It reads and writes streams, buffers, and file paths.

Jimp loads and edits images in JavaScript for Node.js and browsers without native dependencies. Its codecs run in JavaScript and use more memory on large images.

In Node.js, sharp resizes an image as one step of its pipeline. In the browser, Pica resizes images without pixelation before they upload.

node-canvas implements the Web Canvas API in Node.js on top of Cairo. Server code draws through a canvas drawing context and saves the result as an image.

sharp runs a native image pipeline in Node.js for converting and resizing large images. Jimp runs entirely in JavaScript in Node.js and browsers at the cost of more memory.

imagemin minifies image files through optimizer plugins, such as jpegtran for JPEG and pngquant for PNG. It writes files only when a destination folder is set.

For coding agents

Found your image processing library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official