i cant use flatternImages() function becouse it's deprecated.
I must use
$im->setImageAlphaChannel(\Imagick::ALPHACHANNEL_REMOVE);
$im->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
But ALPHACHANNEL_REMOVE constant is undefined.
How can i solve this issue?
P.S. I tried to use 11 instead \Imagick::ALPHACHANNEL_REMOVE and get error:
"Unable to set image alpha channel"