Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
<?php
exec('convert source.jpg -bordercolor 000000 -border 3x3 step1.ppm'); // add small black border
exec('convert step1.ppm -bordercolor white -border 2x2 step2.ppm'); // add white line around the image
exec('convert step2.ppm -bordercolor 000000 -border 10%x10% step3.ppm'); //add a wide black border around
exec("convert step3.ppm -size 15x15 xc:black -background black -append -font 'roman.ttf' -pointsize 64 -fill white -draw \"gravity South text 0,0 'SOME TITLE'\" text1.ppm");
exec("convert text1.ppm -size 15x15 xc:black -background black -append -font 'roman.ttf' -pointsize 32 -fill white -draw \"gravity South text 0,0 'MORE TEXT MORE TEXT MORE TEXT MORE TEXT '\" step4.jpg");
?>
<?php
exec('convert source.jpg -bordercolor black -border 3x3 step1.ppm'); // add small black border
exec('convert step1.ppm -bordercolor white -border 2x2 step2.ppm'); // add white line around the image
exec('convert step2.ppm -bordercolor black -border 10%x10% step3.ppm'); //add a wide black border around
exec("convert step3.ppm -font 'roman.ttf' -pointsize 64 -fill white -draw \"gravity South text 0,0 'SOME TITLE'\" -pointsize 32 -fill white -draw \"gravity South text 0,-20 'MORE TEXT MORE TEXT MORE TEXT MORE TEXT '\" step4.jpg");
?>
<img src="step4.jpg">
Read the image in and resize it and add the borders; create a black background and put the image onto it. Write the text directly to the first image.
<?php
exec("convert \( source.jpg -resize 250x250 -bordercolor black -border 3x3 -bordercolor white -border 2x2 \) -size 300x400 xc:black -gravity north -geometry +0+30 +swap -composite border.png");
exec("convert border.png -pointsize 32 -fill white -draw \"gravity South text 0,60 'SOME TITLE'\" -pointsize 16 -gravity south -annotate +0+30 \"MORE TEXT MORE TEXT\\nMORE TEXT MORE TEXT \" text.png");
?>
<img src="text.png">
Read the image in and resize it and add the borders; create a black background and put the image onto it. Write the text to another image then paste the text onto the first image.
<?php
exec("convert \( source.jpg -resize 250x250 -bordercolor black -border 3x3 -bordercolor white -border 2x2 \) -size 300x400 xc:black -gravity north -geometry +0+30 +swap -composite border.png");
exec("convert \( -size 300x100 -background black -font verdana.ttf -fill white -gravity North caption:\"The quick red fox jumped over the lazy brown dog.\" -flatten \) border.png -gravity south +swap -composite caption1.jpg");
?>
The only thing is you would need to use something like getimagesize and and use the values in your code e.g replace -size 300x400 with -size {$width}x{$height}