Can anyone explain me how to convert imagick cli command that are working fine into PHP code using Imagick pecl?
I am not familiar enough with syntax of convert
command and it is complex for me to do it quickly.
You may not read this heap of text bellow, just help to convert cli command to PHP. :)
I have one partially transparent figure located on not transparent white background(original image). With filling that transparent figure some background color/image I'll have many colored figures on white background.
What i need now(and where imagick comes in): I need remove that white background on result image so the only colored figure stays there with some blured edges on transparent backround.
What i am doing:
I fill original image with black color to get more contrast black figure on white background. Next, remove white background with command:
convert ./black.png -fuzz 70% -fill none -floodfill +0+0 white -channel A -blur 0x1 ./mask.png
So i have some transparent mask to use in future.
Apply mask.png to some colored image(green.php) that was got from original too:
convert ./green.png -alpha Off ./mask.png -compose CopyOpacity -composite PNG32:result.png
That commands have to be translated into PHP. Can anyone advice me?