GetImagePixels
Posted: 2009-10-19T16:38:23-07:00
I have been working on a project in which i need to get all of the pixel information from a picture. I found ImageMagick and MagickWand, and installed them on my server. I tried to follow the vague example given in the information on the MagickWand site, and cannot get the MagickGetImagePixels to return anything but the word "Array"
I used that test code just to see if i can get it to work, but it doesn't. What am i doing wrong?
Code: Select all
<?php
$magick_wand = NewMagickWand();
MagickReadImage($magick_wand, $_GET['image']);
$height = MagickGetImageHeight($magick_wand);
$width = MagickGetImageWidth($magick_wand);
$pixels = MagickGetImagePixels($magick_wand, 0, 0, 20, 24, 'RGBA', MW_charPixel);
print$height . ", " . $width;
echo"<br />";
print "RGB(" . $pixles[1] . ", " . $pixles[2] . ", " . $pixles[3] . ");";
echo"<br />";
?>