Ejemplo #1 Ejemplo con imagecopymerge() para crear un sello digital translúcido
<?php
// Carga el sello y la foto para aplicar el sello digital
$im = imagecreatefromjpeg('photo.jpeg');
// Primero, creamos un sello manualmente usando GD
$stamp = imagecreatetruecolor(100, 70);
imagefilledrectangle($stamp, 0, 0, 99, 69, 0x0000FF);
imagefilledrectangle($stamp, 9, 9, 90, 60, 0xFFFFFF);
imagestring($stamp, 5, 20, 20, 'libGD', 0x0000FF);
imagestring($stamp, 3, 20, 40, '(c) 2007-9', 0x0000FF);
// Define los márgenes del sello y obtiene la anchura y altura del sello
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);
// Fusiona el sello en nuestra foto con una opacidad del 50%
imagecopymerge($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp), 50);
// Guarda la imagen en un archivo
imagepng($im, 'photo_stamp.png');
?>