2013-12-20 4 views
0

흰색 배경을 흰색으로 제거하는 기능을 가지고 있지만 새로운 이미지에 새 이미지를 복사하려고 할 때 화상 복사 이미지가 여전히 흰색 배경에 있습니다. 누군가가 잘못되어 가고 있다고 말할 수 있다면 나는 일하기로되어 있기 때문에 지금은 좌절감을 느낄 정도로 위대 할 것입니다. 또한 페인트로 만든 이미지를 열면 흰색 배경이 나타납니다. 출력 된 이미지는 투명하지만 복사본에는 흰색 배경이 있습니다. 사전 여기 에서 덕분에 코드PHP - 흰색에서 투명한 배경 만들기

public function transparent_background($filename, $color, $image) 
{ 
    $img = imagecreatefromjpeg($image); 
    $colors = explode(',', $color); 
    $remove = imagecolorallocate($img, $colors[0], $colors[1], $colors[2]); 
    imagecolortransparent($img, $remove); 
    imagepng($img, $filename,0); 
    return $img; 
} 

답변

0

그것은 타이핑 실수입니다

세 번째 매개 변수

public function transparent_background($filename, $color,$imgage) 

날이었다

public function transparent_background($filename, $color,$image) 
+0

시도를 볼 수 잘못 여기에 입력하려고합니다. 거기에 문제가 여전히 거기에 흰색 배경에 copy \ – emuigai