[magick-users] Problem with SetPixel (PerlMagick)
Tomas Hanslik
dunric29a at gmail.com
Mon Oct 13 12:23:59 PDT 2008
What am I doing wrong, ie. how to set pixel by SetPixel with RGB color
specification ?
May it be a bug in SetPixel code ?
______________________________________________
use Image::Magick;
my $img = Image::Magick->new(size=>'640x480');
$img->ReadImage('xc:red');
my @rgb = $img->GetPixel(x=>1,y=>1); # @rgb is set properly to (1,0,0) for
red color
print "@rgb\n";
$img->SetPixel(x=>1,y=>1,color=>\@rgb); # reset the same pixel with red
color
@rgb = $img->GetPixel(x=>1,y=>1); # GetPixel now returns (1,1,1) which
represents white !! Red (1,0,0) expected !
print "@rgb\n";
______________________________________________
Any help would be appreciated.
More information about the Magick-users
mailing list