Skip to content
Image KB Reducer
Esc
↑↓navigate↵open⌘Jpreview
On this page

Install

Two bin names, one binary: imagekbreducer and ikb.

No install

npx imagekbreducer <command> [inputs...] [flags]
npx ikb <command> [inputs...] [flags]

Global install

npm install -g imagekbreducer

The package name is unscoped (imagekbreducer, not @imagekbreducer/cli) specifically so npx imagekbreducer resolves at all — npx refuses to guess an executable name for a scoped package with more than one bin entry, and this package ships two: imagekbreducer and the shorter ikb. Both point at the identical binary; there is no behavioral difference between them.

Requires Node 22 or later.

Everything after this page

imagekbreducer <command> [inputs...] [flags]
ikb             <command> [inputs...] [flags]

Seven commands: compress, resize, convert, crop, rotate, strip, info. Each has its own flags; a set of global flags applies to every command that writes a file. This is the exact line imagekbreducer --help prints for it:

Global: --out <dir> | --in-place | --suffix <text> (default "-compressed") | --force · --dry-run · --json · --quiet · --accept-closest · --help · --version

Flags recognized globally

Flag Meaning
--out <dir> write outputs into <dir> instead of next to each input
--in-place overwrite the input itself (the only flag that does)
--suffix <text> filename suffix before the extension, default -compressed
--force replace an existing output file that isn’t the input (see Output files)
--dry-run do everything except write; the printed/JSON byte counts are still real
--json print the JSON envelope to stdout instead of human text
--quiet silence stderr (progress, summaries, warnings, error sentences)
--accept-closest on an otherwise-unreachable target, write the closest file found instead of failing
--help / -h print usage (bare, or <command> --help for just that command’s line)
--version / -v print the installed version

--out and --in-place are mutually exclusive; combining them is a usage error (exit 2).

Was this page helpful?