WebP Metadata: Exif, XMP, and ICC Profile Management
Learn how WebP stores Exif, XMP, and ICC colour profile metadata in RIFF chunks, and how to copy, strip, or inspect metadata with cwebp and webpinfo.
WebP supports embedding Exif, XMP, and ICC colour profile metadata inside optional RIFF chunks, letting you preserve camera data, copyright information, and colour accuracy without a separate sidecar file. Because these chunks are all optional and clearly delimited by the RIFF structure, you can add, remove, or inspect them independently without touching the image data itself.
Metadata Chunk Types #
WebP stores three distinct categories of metadata, each in its own named RIFF chunk:
EXIF Chunk #
Stores camera-capture settings copied from the source image: aperture, shutter speed, ISO, focal length, GPS coordinates, timestamp, and device make and model. The payload is image metadata in Exif format — a TIFF-structured IFD tree containing the capture settings and device information.
XMP Chunk #
Stores structured descriptive metadata in RDF/XML format: creator, copyright holder, usage rights, keyword tags, and Dublin Core fields. XMP is the preferred standard for editorial and rights-management workflows.
ICCP Chunk #
Stores a raw ICC colour profile binary blob. Renderers use it to map the image’s encoded colour values to accurate display colours, essential for photography portfolios, e-commerce product shots, and print-preview workflows.
All three chunks are present only in extended WebP files (those that begin with a VP8X chunk). The VP8X flags byte signals which metadata chunks follow, so a conforming decoder can skip directly to the image data if it does not need metadata.
Preserving Metadata During Conversion #
By default, cwebp strips all metadata from the output file to produce the smallest possible result. Use the -metadata flag to control exactly which metadata types carry over from the source.
# Copy all metadata — Exif, XMP, and ICC colour profile
cwebp -q 80 -metadata all input.jpg -o output.webp
# Copy only the Exif block (camera settings, GPS, timestamps)
cwebp -q 80 -metadata exif input.jpg -o output.webp
# Copy only the XMP block (copyright, creator, keyword tags)
cwebp -q 80 -metadata xmp input.jpg -o output.webp
# Copy only the ICC colour profile
cwebp -q 80 -metadata icc input.jpg -o output.webp
# Copy Exif and XMP but omit the ICC profile
cwebp -q 80 -metadata exif,xmp input.jpg -o output.webp
# Strip all metadata — smallest output, privacy-safe (this is the default)
cwebp -q 80 -metadata none input.jpg -o output.webp
Stripping metadata is irreversible. Once you run a bulk conversion with
-metadata none, the original Exif, XMP, and ICC data are permanently lost from the output files. Always keep the originals in a separate location before running any metadata-removing batch job.
Inspecting Metadata #
Use the webpinfo command-line tool (bundled with the libwebp distribution) to examine the chunk structure and metadata of any WebP file without decoding the image:
# Display all chunk information — sizes, flags, and metadata chunk presence
webpinfo output.webp
# Display a concise image summary — dimensions, codec, and feature flags
webpinfo -summary output.webp
webpinfo output lists each chunk FourCC, its byte offset, and its payload size. Look for EXIF, XMP , and ICCP entries in the output to confirm which metadata chunks are present.
Pipe webpinfo output through grep to quickly check for a specific chunk across many files in a batch:
# Check which files in a directory contain an EXIF chunk
for f in *.webp; do
echo -n "$f: "
webpinfo "$f" | grep -c "EXIF"
done
Stripping Metadata for Web Delivery #
For public-facing web delivery, stripping metadata is best practice for two reasons:
- Reduce file size — Metadata chunks — especially large ICC profiles or verbose XMP packets — can add several kilobytes to each image. Stripping them before deployment reduces payload size and speeds up page load times.
- Protect user privacy — Exif GPS coordinates embedded in photos taken on a mobile device can reveal the physical location where an image was captured. Strip Exif data before publishing user-generated content or any image whose capture location should not be public.
Because -metadata none is the cwebp default, you get stripped output unless you explicitly request preservation. Add -metadata all (or specific type names) only when your workflow requires downstream metadata consumption.
ICC Profiles and Colour Accuracy #
If you are delivering colour-critical images — photography portfolios, e-commerce product shots, or digital print proofs — preserve the ICC chunk with -metadata icc. Without it, browsers and colour-managed applications fall back to assuming sRGB, which may produce a visible colour shift for images captured in a wide-gamut colour space such as Adobe RGB or Display P3.
# Preserve ICC profile for colour-critical photography
cwebp -q 90 -metadata icc product-shot.jpg -o product-shot.webp
If you need to manipulate metadata after conversion — for example, to inject a new XMP rights statement or swap an ICC profile — consider ExifTool (exiftool) or ImageMagick (magick). Both tools can read and write WebP metadata chunks directly without re-encoding the image data:
# Read all metadata from a WebP file with ExifTool
exiftool output.webp
# Remove GPS data in-place with ExifTool
exiftool -GPS:All= output.webp
# Strip all metadata with ImageMagick (re-encodes; use with care)
magick input.webp -strip output-stripped.webp
