@343dev/guetzli

中文文档
1.3.0发布于 2026/06/25Apache-2.0ES Module零依赖近 30 天下载 1.3万

guetzli binary wrapper

原始使用文档
文档目录4 节
  1. Introduction
  2. Usage
  3. Command line flags
  4. Notes

@343dev/guetzli

Guetzli avatar: A graphic representation of a round biscuit with a scalloped edge, yellow in color, and topped with three evenly spaced red circles.

npm

google/guetzli binary wrapper for Node.js

Supported:

  • OS platform: darwin, linux, win32.
  • CPU architecture: arm64, x64.

Introduction

Guetzli is a JPEG encoder that aims for excellent compression density at high visual quality. Guetzli-generated images are typically 20-30% smaller than images of equivalent quality generated by libjpeg. Guetzli generates only sequential (nonprogressive) JPEGs due to faster decompression speeds they offer.

Usage

Install:

npm i -g @343dev/guetzli

Compress:

guetzli [flags] input_filename output_filename
# or
cat image.jpg | guetzli - - > result.jpg

Command line flags

  • --verbose — Print a verbose trace of all attempts to standard output.
  • --quality Q — Visual quality to aim for, expressed as a JPEG quality value (in units equivalent to libjpeg quality).
  • --memlimit M — Memory limit in MB. Guetzli will fail if unable to stay under the limit. Default is 6000 MB.
  • --nomemlimit — Do not limit memory usage.

Notes

Guetzli uses a large amount of memory. You should provide 300MB of memory per 1MPix of the input image.

Guetzli uses a significant amount of CPU time. You should count on using about 1 minute of CPU per 1 MPix of input image.

Guetzli assumes that input is in sRGB profile with a gamma of 2.2. Guetzli will ignore any color-profile metadata in the image.

Guetzli is designed to work on high quality images. You should always prefer providing uncompressed input images (e.g. that haven't been already compressed with any JPEG encoders, including Guetzli). While it will work on other images too, results will be poorer. You can try compressing an enclosed sample high quality image.

JPEG images do not support alpha channel (transparency). If the input is a PNG with an alpha channel, it will be overlaid on black background before encoding.

版本与发布记录

@343dev/guetzli 共发布 5 个版本,首次发布于 2024/10/22;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.3.0latest2026/06/254 个月前
1.2.02026/01/0210 个月前
1.1.02025/04/101.6 年前
1.0.12024/10/222 年前
1.0.02024/10/222 年前

关于 @343dev/guetzli 的常见问题

@343dev/guetzli 是什么?

guetzli binary wrapper

如何安装 @343dev/guetzli?

在项目目录运行 npm install @343dev/guetzli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 guetzli,可以用 npx guetzli 直接运行。

@343dev/guetzli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/343dev__guetzli 是否存在。

@343dev/guetzli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@343dev/guetzli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.17。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@343dev/guetzli 可以商用吗?

@343dev/guetzli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@343dev/guetzli 的下载量有多少?

根据 npm 官方下载统计,@343dev/guetzli 在 2026/10/05 – 2026/11/03 这 30 天内被下载 12,526 次,日均约 418 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@343dev/guetzli 还在维护吗?

最新版本 1.3.0 发布于 2026/06/25(4 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 2 个;首次发布于 2024/10/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。