Photos carry hidden metadata: camera model, timestamps, editing software — and often GPS coordinates of exactly where the shot was taken. Publishing images with that intact is both a page-weight cost and a privacy leak. This guide strips EXIF, GPS and ICC metadata from a whole folder in one command with assetopt, locally and with no upload.
The short version: it’s the default
assetopt strips image metadata by default (stripMetadata: true). So the base command already does it:
npm install -g @assetopt/cli
assetopt optimize ./images
Every JPEG, PNG, WebP and AVIF written to the output folder has its EXIF/ICC metadata removed — you get the privacy win and a smaller file, with nothing to configure. Your originals are left untouched.
Verify it worked
Check an output file with exiftool (or any EXIF viewer). Before, a camera JPEG is full of tags:
exiftool ./images/beach.jpg | grep -Ei 'gps|make|model|date'
# GPS Latitude ... / Camera Model Name ... / Create Date ...
After optimizing, the same query on the output file comes back essentially empty:
assetopt optimize ./images
exiftool ./optimized/beach.jpg | grep -Ei 'gps|make|model|date'
# (nothing — metadata stripped)
How much does it save?
Metadata is usually a few KB per image — modest on a large photo, but meaningful across a folder of hundreds, and it’s a pure win since it never affects visible quality. Measure it on your own set with a dry-run that writes nothing:
assetopt analyze ./images
(Most of the savings on photos come from recompression; metadata stripping is the privacy-motivated part that also trims a little off the top.)
When you want to keep metadata
Some workflows need metadata preserved — color-managed print prep (ICC profiles), or photography where you want the EXIF to travel with the file. Two ways to keep it:
Turn the flag off explicitly:
{ "images": { "stripMetadata": false } }
Or use the quality preset, which is fidelity-first and preserves metadata (and pins a high quality floor) in one line:
{ "preset": "quality" }
See compress images without losing quality for when the quality preset is the right call.
Strip metadata as part of a bigger optimization
Because stripping is on by default, it happens automatically whenever you optimize — including in a pre-deploy or CI run. There’s no separate “remove metadata” step to add; it’s baked into every assetopt optimize.
Next steps
npm install -g @assetopt/cli
assetopt optimize ./images # strips EXIF/GPS/ICC by default
See the feature catalog for the full image defaults, including per-format quality and the stripMetadata behavior.