[magick-users] perl pixel manipulator

arcanaimperii at imagemagick.org arcanaimperii at imagemagick.org
Wed Oct 24 20:03:56 PDT 2007


> multi-megapixel images, doing it a pixel at a time would be
> intolerably slow.

Modern versions of PerlMagick incudes the GetPixel()/SetPixel().  An efficient
access method would be to grab and update one image scanline at a time.  To
change a single pixel, use

  @pixels=$image->GetPixel(x=>1,y=>1);
  $pixels[0]*=0.5;
  $image->SetPixel(x=>1,y=>1,color=>\@pixels);



More information about the Magick-users mailing list