【发布时间】:2013-09-07 09:52:59
【问题描述】:
我使用 PHP Imagick 处理图像,我需要将 EPS 文件转换为 PNG 文件,接下来剩余的代码可以处理创建的 PNG,我能够将 EPS 转换为 PNG 并可以处理,但是当我这样做时PNG文件是用白色背景创建的,我希望它是透明的,EPS文件也没有任何背景。 我的代码如下
$img = new Imagick();
$img->setResolution(300,300);
$img->readImage('my_file.eps); //reading the file
$img->setBackgroundColor ('#623423'); //setting background color but not working
$img->setImageFormat("png"); //setting the format to save//converting
$img->writeImage('converted.png'); //saving the converted file
但是生成的 png 带有白色背景,有人可以帮助我如何在没有背景颜色(透明)的情况下创建它吗? 提前致谢!
【问题讨论】:
-
你能提供一个透明的eps图像吗?我找不到它。您是否发现在“my_file.eps”之后缺少引号?
标签: php image-processing imagemagick gd imagick