Page 1 of 1

How to apply a ICC profile

Posted: 2012-07-17T04:42:33-07:00
by ademmler
Hi to all, I have 2 questions ....

1. How can I set IM to use a specific ICC profile for colorspace => 'CMYK' conversion?
2. I have tried to apply a CMYK ICC to an image. I have tried out this:

#read rgb image into memory
my $image = Image::Magick->new();
$image->Read( $infile );
$image->Set( depth => 8 );
$image->Set( colorspace => 'CMYK' );

#get icc as objetc
open(FILE, $iccprofile) or die "Couldn't open $iccprofile: $!";
binmode FILE;
my $profile = join("", <FILE>);
close FILE;

#set icc profile tried 2 methods
a) $image->Profile(name => '', profile => $profile);
b) $image->Set(name => '', profile => $profile);

#write back to file
$image->Write( filename => $outfile );
exit 0;