项目的 README,来自 github.com/jimp-dev/jimp。合并为一个 markdown 文件:README.md。
JavaScript Image Manipulation Program
An image processing library for Node and the browser written entirely in JavaScript, with zero native dependencies
npm install jimp
Jimp 2.0 needs Node.js 22 or later.
import { Jimp } from "jimp";
const image = await Jimp.read("test.png");
image.resize({ w: 256 });
await image.write("test-small.png");
Methods like resize only change the image in memory, so call write (or getBuffer) to save the result. To start from a blank image, use new Jimp({ width, height, color }). To load an image you already have in memory, use await Jimp.fromBuffer(buffer). See Getting Started.
Read the full docs. Upgrading? See the v2 migration guide if you're on 1.x, or the v1 migration guide if you're on v0.
If you want to extend jimp or omit types or functions, create a custom Jimp with createJimp from @jimp/core. See the Custom Jimp guide.
Please read the CONTRIBUTING documentation.
To report a vulnerability, please follow the security policy. Don't open a public issue.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!