jimp README

项目的 README,来自 github.com/jimp-dev/jimp。合并为一个 markdown 文件:README.md。

Jimp

JavaScript Image Manipulation Program

An image processing library for Node and the browser written entirely in JavaScript, with zero native dependencies

Documentation · Getting Started · Playground

Installation

npm install jimp

Jimp 2.0 needs Node.js 22 or later.

Usage

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.

Custom Jimp

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.

Contributing

Please read the CONTRIBUTING documentation.

Security

To report a vulnerability, please follow the security policy. Don't open a public issue.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Andrew Lisowski

💻 🚇 📖 ⚠️

Oliver Moran

💻

strandedcity

💻

Edgar Hipp

💻

Corbin Crutchley

💻

Max G J Panas

💻

Michael Vogt

💻

Marcolino

💻

iwsfg

💻

arlecchino

💻

super-ienien

💻

Bennett Somerville

💻

Florian Barth

💻

Adam Rackis

💻

Aurélio A. Heckert

💻

Daniel Tian

💻

Jeff Bonnes

💻

Russley Shaw

💻

CodeLenny

💻

Sebastian Skałacki

💻

Turan Rustamli

💻

Vlad Turak

💻

ozelot379

💻

Adam Jones

💻

Ahmad Awais ⚡️

💻

Andrei Picus

💻

Andy Chou

💻

Arjun Khoosal

💻

Arman

💻

Autom3

💻

Bernardo Farah

💻

Boon

💻

BrianRosamilia

💻

Carter Bancroft

💻

Chad Banfield

💻

Charaf Salmi

💻

ciffelia

💻

Cody Schrank

💻

Cru Scanlan

💻

Curtis Autery

💻

Dan

💻

Daniel Holmes

💻 ⚠️

Daniel Tschinder

💻

Daniel Kimani

💻

Dara Kong

💻

Denis Bendrikov

💻

Dennis Bartlett

💻

Dominique Rau

💻

Eirik Birkeland

💻

Emily Marigold Klassen

💻

Emmanuel Bourgerie

💻

Endre Szabo

💻

Eric Rabil

💻

Gal Horowitz

💻

GlitchyPSI

💻

Gustavo Ramos Rehermann

💻

Han Kruiger

💻

Igor Borges

💻

Ivan Ganev

💻

Ivan Koprda

💻

iwasawafag

💻

Jake Champion

💻

James Harris

💻

James Ross

💻

Jeremy Katz

💻

Jeroen Claassens

💻

Johannes Goslar

💻

J D Carmichael

💻

John-Robert Yrjölä

💻

Jordan Danford

💻

Joseph

💻

Keith

💻

Keith Mitchell

💻

Kwyn Alice Meagher

💻

Lucy

💻

Marat Nagayev

💻

Marcel Mundl

💻

Mario Adrian

💻

Martin Trobäck

💻

Matt Mc

💻

Max

💻

Maël Nison

💻

Michael Elhadad

💻

Milos Bejda

💻

Mithgol

💻

Nicolas Giard

💻

Nam Bok Rodriguez

💻

Nate Cavanaugh

💻

Nik

💻

Olly Banham

💻

Pasi Eronen

💻

Pavel Volyntsev

💻

Peter Theill

💻

Philip Hannent

💻

Philipp Laube

💻

Rahil Kabani

💻

Rob Moore

💻

Ruben Bridgewater

💻

Sam Broner

💻

Sam MacPherson

💻

Sander Weyens

💻

Shen Yiming

💻

Stefan Lau

💻

Steve Bazyl

💻

Steve Mao

💻

Stuart Hinson

💻

Tom Bull

💻

TonyStr

💻

Laurent

💻

Vincent Dufrasnes

💻

Vladimir Starkov

💻

Vojtěch Štěpančík

💻

William Friesen

💻

Xiliang Chen

💻

Yonggang Luo

💻

austinfrey

💻

brownrw8

💻

Eliott C.

💻

d07RiV

💻

fabb

💻

fratzinger

💻

Guillem Cruz

💻

krudos

💻

mLuby

💻

mfuatnuroglu

💻

Matt Misbach

💻

netdown

💻

nopeless

💻

Oz Weiss

💻

popinguy

💻

qw3n

💻

rifflock

💻

s4tori

💻

sertal70

💻

xinbenlv

💻

xinnix

💻

彭君怡

💻

Andrey Kutejko

📖

Ihor Bodnarchuk

📖

Daniell

💻

MD KHAIRUL ISLAM

⚠️ 💻

JunkMeal

📖

Nicolas Morel

💻

Zach Stevenson

💻

AnotherPillow

📖

Dathan

💻

Juan Pablo Garcia Ripa

📖 🚇 ⚠️ 💻

Ben McCann

💻

Ilyas Landikov

💻

Bishwajeet Parhi

📖

Shrusti-pk

⚠️ 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

jimp (jimp-dev/jimp)

正在搜索数据库…

14.7K ·GitHub
这是什么?Jimp 是一个完全用 JavaScript 编写的图像处理库,面向 Node.js,没有任何外部或原生依赖。
它是独立应用,还是我可以加到代码里的库?它是一个库,通过包管理器安装,并导入到你的 Node.js 项目中;它是模块化的,你可以添加或移除自定义插件以及文件类型的编码器/解码器。
怎样把它加到项目里?安装该包,然后在 Node.js 代码中通过 require 或 import 引入 Jimp,再使用其 API 来加载、处理和保存图片。
我是否需要先安装 GraphicsMagick 或 ImageMagick 这类原生库?不需要。Jimp 完全由纯 JavaScript 编写,没有任何外部或原生依赖。
它是否需要特定版本的 Node?根据 engines 字段,该项目要求 Node.js 18 或更高版本。
谁会用到它?需要在不安装原生图像库的情况下处理或操作图片(如缩放、裁剪、模糊、合成等)的 Node.js 开发者。
没有服务器或网络连接也能用吗?由于它是纯 JS 库,不依赖任何外部服务,所有处理都在本地的 Node 进程中完成。
除了 Node,我能在浏览器里使用 Jimp 吗?仓库中包含 test:browser 脚本和浏览器构建目标,表明 Jimp 除 Node.js 外也可以在浏览器环境中运行。
这个项目还在积极维护吗?是的。它在 GitHub 上有超过 14,000 个 star,有活跃的 CI 流程(build.yml、deploy.yml),还有一长串贡献者,说明项目在持续维护。
我能用自定义插件扩展 Jimp 吗?可以。Jimp 支持自定义插件,你可以通过 @jimp/custom 添加或移除文件类型的编码器/解码器以及图像处理方法。
项目内部使用什么包管理器?仓库使用 pnpm 和 turbo(一个 monorepo 构建系统)来构建、检查代码风格和测试其中的各个包。
作者
jimp-dev
大小
458.3 MB
星标
14.7K
时长
12年
提交 · 90 天