Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 16, 2026·3 min de lectura

Jimp — Pure JavaScript Image Processing for Node.js

An image processing library written entirely in JavaScript with zero native dependencies, supporting resize, crop, color manipulation, and format conversion.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Jimp Overview
Comando CLI universal
npx tokrepo install 0b52787e-50ff-11f1-9bc6-00163e2b0d79

Introduction

Jimp (JavaScript Image Manipulation Program) is a pure-JavaScript image processing library for Node.js that requires no native addons like libvips or ImageMagick. It reads, manipulates, and writes images using only JavaScript, making it easy to deploy in constrained environments like serverless functions and Docker scratch containers.

What Jimp Does

  • Reads and writes PNG, JPEG, BMP, TIFF, and GIF (first frame) images
  • Resizes with multiple interpolation algorithms (bilinear, bicubic, nearest-neighbor, Hermite)
  • Applies color transformations: brightness, contrast, saturation, hue rotation, greyscale, sepia
  • Composites images with alpha blending, masks, and per-pixel operations
  • Draws text using bitmap fonts (BMFont format) without system font dependencies

Architecture Overview

Jimp represents images as flat RGBA pixel buffers backed by standard ArrayBuffers. Each manipulation method iterates over the buffer in-place or produces a new buffer, using pure-JavaScript codecs for format decoding and encoding. The plugin architecture allows extending Jimp with custom operations registered via Jimp.prototype. Because there are no native bindings, Jimp runs identically across all platforms Node.js supports.

Self-Hosting & Configuration

  • Install from npm — no build step, no native compilation, no system libraries needed
  • Chain operations fluently: image.resize(w, h).rotate(90).quality(80).write(path)
  • Use Jimp.AUTO for width or height to maintain aspect ratio during resize
  • Load images from file paths, URLs, or Buffers
  • Export to Buffer for streaming to S3, HTTP responses, or other services without temp files

Key Features

  • Zero native dependencies — deploys without libvips, sharp, or ImageMagick
  • Works in AWS Lambda, Vercel Functions, and other read-only filesystem environments
  • Pixel-level access via image.scan() for custom filters and analysis
  • Built-in hash functions (pHash, average hash) for duplicate image detection
  • Over 14,600 GitHub stars and 5 million weekly npm downloads

Comparison with Similar Tools

  • sharp — much faster (uses libvips C library); Jimp trades speed for zero native deps and portability
  • ImageMagick/GraphicsMagick — CLI tools with Node bindings; Jimp needs no system packages installed
  • canvas (node-canvas) — Cairo-based 2D drawing; Jimp is focused on image manipulation not rendering
  • Pillow (Python) — Python image library; Jimp is the Node.js pure-JS equivalent
  • Squoosh — browser WASM codecs; Jimp is Node-native and requires no WASM runtime

FAQ

Q: Is Jimp fast enough for production image processing? A: For low-volume tasks (thumbnails, avatars, watermarks) it is fine. For high-throughput pipelines processing thousands of images per minute, sharp is a better choice due to native performance.

Q: Can I use Jimp in the browser? A: The core library targets Node.js, but community forks like jimp/browser offer limited browser support via Webpack/Rollup bundling.

Q: Does it support animated GIFs? A: Jimp reads only the first frame of animated GIFs. For full animation support, consider libraries like gif-encoder or sharp.

Q: How do I add text to images without system fonts? A: Jimp uses BMFont bitmap fonts. Load a .fnt file with Jimp.loadFont() and render text with image.print(). Pre-built fonts are included for common sizes.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados