2017-09-28 83 views
0

我想合併2個圖像,都與透明alpha層png。但我得到了這個screenshot。 圖片'A'字母只是抹去其他圖像,並使其透明。這裏是我的代碼PHP合併圖像保存透明

$letterimg = imagecreatefrompng('assets/img/qr/a2.png'); 
$codeimg = imagecreatefrompng('assets/img/qr/'.$code.'.png'); 

imagesavealpha($letterimg,true); 

imagecopy($codeimg,$letterimg,50,50,0,0,imagesx($codeimg),imagesy($codeimg)); 

header('Content-Type: image/png'); 
imagepng($codeimg); 

回答

0

問題是由RGB圖像改變顏色模式爲索引顏色

解決