Rubblewebs

THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.

I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.

IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.

Background

Watermarked background

Background example
 
// Create the text
$cmd = "-size 215x68 xc:none -font $font1 -pointsize 25 -fill white ".
" -gravity northwest -annotate +15+10 Boots ".
" -gravity southeast -annotate +10+0 Boots -shade 240x40";
exec("convert $cmd font.png");

// Create the gradiant
exec("convert -size 341x256 gradient:pink-red gradient.png");

// Put the text over the gradiant
exec("composite -watermark 40% -tile font.png gradient.png watermark.png"); 

// Put the image over the watermarked gradiant
exec("convert watermark.png $input15 -gravity center -composite background.png");

Unlink('font.png');
Unlink('gradient.png');
Unlink('watermark.png');


Back