Posted in PHP onJanuary 26, 2015
参考资料:
http://www.php.net/manual/zh/book.imagick.php
前提
$im = new Imagick("test.psd");
获取图层数目
$num_layers = $im->getNumberImages();
获取所有参数:
for ($i = 0, $num_layers = $im->getNumberImages(); $i < $num_layers; ++$i) { $im->setImageIndex($i); //this $im->setIteratorIndex($i); //or this is kinda redundant $pagedata=$im->getImagePage(); //print("x,y: " + $pagedata["x"].", ".$pagedata["y"]."<br/>\n"); //print("w,h: " + $pagedata["width"].", ".$pagedata["height"]."<br/>\n"); foreach($im->getImageProperties("*") as $k => $v) print("$k: $v<br/>\n"); //export layer //$im->writeImage('layer_' . $i . '.png'); //导出所有图层到单独的png文件 }
PHP中使用Imagick操作PSD文件实例
- Author -
junjie声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@