How to apply a ICC profile

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
ademmler
Posts: 1
Joined: 2012-07-17T04:27:59-07:00
Authentication code: 15
Location: Bavaria

How to apply a ICC profile

Post 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;
thx for help
Alexander
Post Reply