Welcome to JimPaint 98
JIMP V1
DOCS

The JavaScript Image Manipulation Program

These are the docs for Jimp v1. The paint program below isn't a screenshot: it's running the real Jimp library in your browser, and every tool you click writes the code to do it yourself.

C:\> pnpm add jimp
GitHub

Did you know…

WHAT'S NEW
★ JPEG writes can keep the original EXIF with { exif: true }   ★ PNG output now picks the smallest lossless colour type by default   ★ pHash takes size and smallerSize options   ★ loadFont explains font errors instead of failing to fetch   ★ The migration guide covers more v0 leftovers   ★ Import Jimp straight from a CDN, no bundler needed   
dice.png - JimPaint 98
Loading Jimp from jsDelivr…
How to play
  1. Pick a tool on the left. Most apply at once; Crop, Pixel Brush and Circle wait for you to click the picture.
  2. Watch Notepad write the matching Jimp code.
  3. Click a colour to tint, right-click it to xor. Ctrl+Z undoes.
COLOR BOXclick: color() mix
right-click: xor · rainbow: hue
Starting up…
—
no edits yet
recipe.js - Notepad
Ln 1, Col 1
0 edits
Node.js
JimPaint Help Topics: Guides

Click a book, and then click a topic.

    Jimp Explorer: API Reference
      NameSignaturePackageDescription
      Jimp v1
      JimPaint 98 is a design exploration for the Jimp docs. Jimp is MIT licensed.
      Not affiliated with any operating system, living or retired. Try the secret code.
      ``` The same file is on unpkg at `https://unpkg.com/jimp@1/dist/browser/index.js`. `jimp@1` always loads the latest v1 release. Pin an exact version such as `jimp@1.7.0` to make sure an update never changes your page. [[try:invert]] The `jimp/fonts` export isn't self-contained, so it can't be imported from a CDN. Load your fonts by URL with `loadFont` instead. ## With hosted file You can initialize a Jimp instance from a URL or a file path. ```ts import { Jimp } from "jimp"; // Read a file hosted on the same domain const image1 = await Jimp.read("/some/url"); // Read a file hosted on a different domain const image2 = await Jimp.read("https://some.other.domain/some/url"); ``` ## With uploaded files Or you can use Jimp with an `ArrayBuffer`. Here we take a user's uploaded image and modify it to greyscale. ```ts async function handleFile(file: File) { const image = await Jimp.fromBuffer(await file.arrayBuffer()); image.greyscale(); output.src = await image.getBase64("image/jpeg"); } ``` > !tip Try it > Use File > Open in JimPaint (or drop a picture on the canvas). Your image never leaves your computer.