image-processingimagemagick

Strip EXIF data without losing color profile: Doesn't work for PNG


To strip EXIF data without losing color profile information, I use

magick input.jpg profile.icm
magick input.jpg -strip -profile profile.icm output.jpg

It works for JPEG, but doesn't seem to work for PNG.

magick input.png profile.icm
magick input.png -strip -profile profile.icm output.png

Whereas input.png has Color LCD color profile, output.png doesn't have any color profile information. Why?

The PNG images and the profile.icm file that was extracted by the first command are here: https://github.com/jsx97/test/blob/main/exif.zip


Solution

  • I think you have to use exiftool rather than Imagemagick to strip just the exif metadata.

    exiftool -EXIF:all= input.png
    

    or

    exiftool -EXIF= input.png
    

    See https://linuxhandbook.com/remove-exif-data/

    But my test on a PNG did not work either. I am not sure why PNG is different.