开发者

How do I remove EXIF tags while preserving the ICC color profile?

I am programmatically generating several sizes 开发者_如何转开发of thumbnails for images.

I need to preserve the color space of an image while removing all (other) EXIF information.

I am using imagick on PHP 5.3, but information on how to do this with any imagemagick API would be helpful.

I'm trying to prune the file size of my image thumbnails as much as possible, but the color space is necessary information or the client doesn't render the colors accurately enough.


To achieve this I used MagickStripImage() to remove all the extraneous data, then ran -convert [inputJPG] -profile [profile] [outputJPG] to add the sRGB profile again.

This worked for my purposes (as I'd already done profile conversion beforehand, so all my profiles are sRGB). I did try Tom's suggestion of using ExifTool (which is fantastic) but couldn't get it to strip out EXIF+XMP+IPTC and leave the profile intact.


Without knowing your exact use case and why you want to do this via php, I was wondering if you tried ExifTool from Phil Harvey? It allows you to add, modify, and delete the typical image metadata. You can edit individual images and whole image batches.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜