$im = imagecreatefrompng('gradient_1.png'); $nWidth = 3 * imagesx($im); $nHeight = 3 * imagesy($im); $newImg = imagecreatetruecolor($nWidth, $nHeight); imagealphablending($newImg, false); imagesavealpha($newImg,true); $transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127); imagefilledrectangle($newImg, 0, 0, $nWidth, $nHeight, $transparent); imagecopyresampled($newImg, $im, 0, 0, 0, 0, $nWidth, $nHeight, imagesx($im), imagesy($im)); header('Content-Type: image/png'); imagepng($newImg); |