Converting layered AI File to PNG
Posted: 2018-10-15T14:22:33-07:00
Hello
I cannot seem to be able to convert a layered AI File properly into a PNG, at least one layer seems to be missing. I am able to convert it using command line properly and am wondering how I can achieve the same using the PHP library, can anyone here help me?
This works just fine:
This does not contain all the layers in the PNG:
I cannot seem to be able to convert a layered AI File properly into a PNG, at least one layer seems to be missing. I am able to convert it using command line properly and am wondering how I can achieve the same using the PHP library, can anyone here help me?
This works just fine:
Code: Select all
$convertCmd = "magick convert " . APP_ROOT . "/user_content/logo_oetwil_ps.ai " . APP_ROOT . "/user_content/logo_oetwil_ps.ai.png";
exec($convertCmd);
Code: Select all
$im = new Imagick();
$im->readImage(APP_ROOT . "/user_content/logo_oetwil_ps.ai");
//$im->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN); // This does not seem to help either
$im->setImageFormat("png");
header("Content-Type: image/png");
echo $im->getImageBlob();