I'm trying to add png image on pdf file using Imagick on Ubuntu Server.
$background = imagecolorallocate($signature_place, 255, 255, 255);
imagefill($signature_place, 0, 0 , $background);
imagecolortransparent($signature_place, $background);
But the background has a dirty white color.
The interesting fact that it works correctly on Windows.
I'm using:
I really don't understand where the error could be.
Did anyone have such problem? Where should I find the error?
This is what I use for PNG
$im = imagecreatefrompng($this->source);
imagealphablending($newImg, false);
imagesavealpha($newImg, true);
$transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127);
imagefilledrectangle($newImg, 0, 0, $newWidth, $newHeight, $transparent);
imagecopyresampled($newImg, $im, 0, 0, 0, 0, $newWidth, $newHeight, $this->srcWidth, $this->srcHeight);
imagepng($newImg, $this->destin);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.