It is possible to get a binary blob by using ImageMagick convert
via PHP's shell_exec()
. It's very difficult to convert such a command to PHP Imagick class. Is there any alternative way to implement this feature?
I am using Imagick like this.
$im = new Imagick('some image');
$im->trimImage(20000);
header ("Content-Type: image/{$im->getImageFormat()}");
echo $im->getImageBlob(); // need output in from of blob
I want do get output result similar to this.
convert imageName.png -alpha set - white -border 1 -fill none -fuzz 3% -draw "color 0,0 floodfill" -shave 1x1 removed_edges.png
If ImageMagick command returns a binary blob instead of writing to a file, my problems will be solved.
convert input.jpg ... PNG:-
convert input.jpg .... RGB:-
ob_start()
andob_get_contents()
by the way.PNG:-
and now it was returning image instead of writing into file.