Back to the snippets index

Add borders

( Anthony 18/6/2008 )

The image is resized first and one border added then the background with the next border is created.

IM code:

<?php  
$cmd 
" \( input.jpg -resize 250x250 -bordercolor coral4 -border 1x1 \) ".
" -size 300x250 xc:black -bordercolor coral4 -border 1x1 ".
"-gravity center +swap -composite "
exec("convert $cmd output.png"); 
?>

Image to go with Add borders example code