{% else-1 %}
Рисуем копирайт на картинку

                        
<?php

$copy = 'copy.png';

/* создаем картинку копирайта */
/* размеры подбирались с учетом шрифта и длинны текста */
$copywidth = 70;
$copyheight = 15;
$im = imagecreatetruecolor($copywidth, $copyheight);

$white = imagecolorallocate($im, 0, 0, 0);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 69, 14, $white);

/* текст копира */
$text = 'Copyright (c)';
/* шрифт копира */
$font = 'arial.ttf';

/*рисуем тень */
imagettftext($im, 8, 0, 4, 11, $grey, $font, $text);
/*рисуем текст копирайта */
imagettftext($im, 8, 0, 3, 10, $black, $font, $text);

imagepng($im, $copy);

$img = 'test.jpg';

$out = imagecreatefromjpeg($img);

list($imgwidth, $imgheight) = getimagesize($img);

$copy = imagecreatefrompng($copy);

/* вычисляем координаты нужного угола (правый нижний)*/
$x = $imgwidth-$copywidth;
$y = $imgheight-$copyheight;
/* левый верхний по умолчанию 0:0 */

/* процент прозрачности */
$percent = 75;

imagecopymerge($out, $copy, $x, $y, 0, 0, $imgwidth, $imgheight, $percent);

$png = 'image/png';
$gif = 'image/gif';
$jpg = 'image/jpeg';
$bmp = 'image/bmp';

header('Content-Type: ' . $png . '');
imagepng($out);

imagedestroy($out);
imagedestroy($copy);
unlink($copy);

?>
0 23 0
Без комментариев...