strip
Remove metadata (EXIF, GPS, ICC, XMP) — losslessly for jpeg/png, by re-encoding for webp.
Remove metadata from an image.
strip <inputs...> [--reencode] # lossless container surgery for jpeg/png; webp needs --reencode; heic: convert --to-format jpeg first
Flags
| Flag | Meaning |
|---|---|
--reencode |
required for webp; refused outright for heic. Not needed (and does nothing extra) for jpeg/png. |
How this differs by source format
jpeg and png are stripped losslessly — container surgery only. No decode, no re-encode, no
pixel touched, so --reencode is neither required nor meaningful for these two; the bytes that
weren’t metadata are untouched.
webp has no lossless metadata-strip path in this engine, so strip on a webp source without
--reencode is a usage error (exit 2) rather than a silent no-op or a fabricated “success” that
left the metadata in place. Pass --reencode to explicitly opt into an ordinary re-encode-to-self
job instead.
heic is refused outright, with or without --reencode. HEIC is decode-only in this engine and
can never be an output format — every other command’s --format keep falls back a HEIC source to
JPEG, and routing strip --reencode through that same fallback would silently hand back a JPEG
under a command named strip. Instead of guessing at a format you never asked for, the tool says
so and points you at convert:
strip: heic is decode-only and can never be an output format, so strip cannot re-encode it --
run 'imagekbreducer convert <file> --to-format jpeg' first, then strip the jpeg
avif is not special-cased the way heic is — --reencode on an avif source builds an ordinary
“re-encode to itself” job, same as webp. It’s the engine, not this command, that then refuses it
with unsupported-format (exit 20): the wasm backend this CLI ships bundles no AVIF encoder. That
is a real engine limitation reported honestly, not a usage mistake this command invents a story
for.
Examples
imagekbreducer strip photo.jpg
imagekbreducer strip photo.heic
# strip: heic is decode-only and can never be an output format, so strip cannot re-encode it --
# run 'imagekbreducer convert <file> --to-format jpeg' first, then strip the jpeg
imagekbreducer convert photo.heic --to-format jpeg
imagekbreducer strip photo-compressed.jpg
imagekbreducer strip banner.webp --reencode
What can go wrong
| Exit | When |
|---|---|
| 2 | webp without --reencode; heic, with or without --reencode |
| 3 | an input doesn’t exist, or a glob matched nothing |
| 4 | the computed output already exists and isn’t the input |
| 20 | unsupported-format — avif with --reencode (no AVIF encoder in this backend) |
| 21, 24 | other engine-side failures on the --reencode re-encode path |
strip has no --to flag and no --format flag: it either preserves the source’s own format
(jpeg/png, and webp/avif with --reencode) or refuses. targetBytes in the
--json envelope is always null.