2013-09-07 2 views
1

PHP Imagick을 사용하여 이미지를 처리하려면 EPS 파일을 PNG 파일로 변환해야하고 나머지 코드는 생성 된 PNG를 처리해야합니다. PNG 파일을 처리 할 수 ​​있지만이 작업을 수행 할 때 PNG 파일이 흰색 배경으로 만들어지기 때문에 EPS 파일의 배경이 투명하지 않은 위치에서 투명하게 만들 수 있습니다. EPS 파일에서 PNG 이미지를 만드는 동안 배경색을 투명하게 설정합니다.

$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 흰색 BG와 함께오고으로 내 코드는, 어떤 사람은 밖으로 BG 색상 (투명)와 그것을 만드는 방법 나를 도와 드릴까요? 미리 감사드립니다.

+0

투명도가 적용된 eps 이미지를 제공 할 수 있습니까? 나는 그것을 발견 할 수 없다. 'my_file.eps'뒤에 따옴표가 누락 된 것을 보았습니까? – Manolo

답변

0

이 예를 보았습니까?

<?php 

$im = new Imagick(); 
$im->setBackgroundColor(new ImagickPixel('transparent')); 

$im->readImage('carte_Alain2.svg'); 

$im->setImageFormat("png32"); 

header('Content-type: image/png'); 
echo $im; 
?> 
+0

예, 사용은 없지만 동일한 상태입니다! –

관련 문제