I want to integrate ImageMagick with GD, manipulating with MagickWand. How can I convert from ImageMagick to GD format?
$dst_img = imagecreatetruecolor($dst_width, $dst_height);
$magick_wand = NewMagickWand();
MagickReadImage( $magick_wand, $src_img );
MagickResizeImage( $magick_wand, $dst_width, $dst_height, MW_LanczosFilter, 1.0 );
$dst_img = $magick_wand; <----------- It fails here
Thanks.
MagickResizeImage and imagecreatetruecolor
Re: MagickResizeImage and imagecreatetruecolor
Looks like you'll need to write blob in a well-known format with GD (e.g. PNG) and then read it as a blob with MagickWand for PHP.
Re: MagickResizeImage and imagecreatetruecolor
So if I read with GD, I must pass it to MagickWand reading as blob?
Read with GD:
$imagecreatefrom = 'imagecreatefrom' . $default_formats[$sizes[2]];
$src_img = @$imagecreatefrom($source)
Then read as blob:
$MagickReadImageBlob( $magick_wand, $src_img );
Process with MagickWand:
MagickResizeImage( $magick_wand, $dst_width, $dst_height, MW_LanczosFilter, 1.0 );
And then back to GD:
$dst_img = MagickGetImageBlob( $magick_wand );
It doesn't work.
Thanks.
Read with GD:
$imagecreatefrom = 'imagecreatefrom' . $default_formats[$sizes[2]];
$src_img = @$imagecreatefrom($source)
Then read as blob:
$MagickReadImageBlob( $magick_wand, $src_img );
Process with MagickWand:
MagickResizeImage( $magick_wand, $dst_width, $dst_height, MW_LanczosFilter, 1.0 );
And then back to GD:
$dst_img = MagickGetImageBlob( $magick_wand );
It doesn't work.
Thanks.