Jump to content

PNG low resolution after merge


brooksh

Recommended Posts

Can anyone tell me how I can make my merge look better. The PNG file I'm using is extremely clear, but when it merges it looks very grainy.

 

function create_watermark($source_photo){
$transparency = 20; //watermark's transparency (0-100
$photo = imagecreatefromjpeg($source_photo);

//watermark
$watermark = imagecreatefrompng('watermark.png');

$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);

//location of the watermark on the source image
$size = getimagesize($source_photo);
$dest_x = ($size[0] - $watermark_width) / 2;
$dest_y = ($size[1] - $watermark_height) / 1;

imagecopymerge($photo, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $transparency);
imagejpeg($photo, $source_photo, 100);
//free memory
imagedestroy($photo);
imagedestroy($watermark);
}//end create_watermark function

create_watermark($file); 

Link to comment
https://forums.phpfreaks.com/topic/120052-png-low-resolution-after-merge/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.