zjwang
zjwang

Reputation: 425

How to use Imagemagick to remove color profile without removing EXIF data?

Image file in my server are processed using imagemagick. Sometimes I get files with color profiles from users and i use -strip to remove them before uploading the images to storage. Using -strip also removed EXIF data from the images. I'm interested to know if there is a way to only remove color profiles and not exif info regarding geo location and camera settings?

Upvotes: 1

Views: 6137

Answers (2)

mkdev
mkdev

Reputation: 1042

Try this one

convert +profile '!exif,*' in.jpg out.jpg

According to the ImageMagick docu you can use +profile to remove the indicated profile. ImageMagick uses standard filename globbing, so wildcard expressions can be used to exclude specific profiles.

So +profile "!exif,*". will remove all profiles from the image except for the EXIF profile.

Upvotes: 6

James Palawaga
James Palawaga

Reputation: 298

Perhaps the +profile flag will work for stripping the colour profiles.

http://www.imagemagick.org/script/command-line-options.php#profile

Upvotes: 2

Related Questions