Preserve ICC-profile

Started by erixon, November 22, 2012, 11:27:23 AM

Previous topic - Next topic

erixon

Thanks for a great tool.

I'm using ImageMagick to create JPG-thumbnails but having the problem with strip() which removes the color-profile-data and makes the images dull.

Instead I should be able to fix this through ExifTool.

I guess it's this I want to do but in Perl?
exiftool -all= --icc_profile:all thumbnail.jpg

Is ICC-profile the only thing I need to preserve?

It sounds like a quite simple task but I'm not have been able to do a working Perl code.

kind regards
Tomas

Phil Harvey

#1
Hi Tomas,

Yup, that's the command.

From the API it is done just like this example in the documentation:

# delete all but EXIF tags
$exifTool->SetNewValue('*');  # delete all...
$exifTool->SetNewValue('EXIF:*', undef, Replace => 2); # ...but EXIF


Except that you specify 'ICC_Profile:*' instead of 'EXIF:*'.  ('ICC_Profile:all' will also work)

- Phil

Edit: Fixed spelling of your name... sorry.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

erixon

Ok thanks, it seems to work

my $et = new Image::ExifTool();
$et->SetNewValue("*");
$et->SetNewValue("ICC_Profile:*" undef, Replace => 2);
$et->WriteInfo($original_file, $thumbnail_file);

/Tomas