Hi i was trying to swap out colors from a template image with other colors, i decided to use the MagickPaintFloodfillImage function to do this. I am not sure if this was a good choice; I am running that function through PHP and was wondering if my code below is correct.
Code: Select all
<?php
$r = NewMagickWand();
MagickReadImage($r, 'redblack.JPG');
$color = NewPixelWand();
PixelSetColor($color, "blue");
$border = NewPixelWand();
PixelSetColor($border, "black");
echo "working checkpoint<br>";
if ( MagickPaintFloodfillImage( $r, $color, 0, $border, 50, 50) != 0 )
{
echo "success";
// MagickEchoImageBlob( $r );
}
else
{
echo MagickGetExceptionString($r);
}
?>
I can get to the "working checkpoint" string but nothing happens afterwards, so this makes me wonder if i'm using the function correctly. Example codes online work with my image but this is my first personal attempt with imagemagick that didn't turn out right.
Also i don't seem to get any error messages, this is really limiting my debugging.