Rubblewebs forum
June 09, 2008, 04:24:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed
 
   Home   Help Search login register  
Pages: [1]
  Print  
Author Topic: Adding a border to rounded image  (Read 320 times)
badaboom
Newbie
*
Posts: 1


View Profile
« on: December 02, 2007, 04:10:20 AM »

How would I add a border to this image:

/imagemagick/other.php?info=rounded_corners.png

Thanks very much,

Tim
Logged
Anthony
Administrator
Newbie
*****
Posts: 16


View Profile
« Reply #1 on: December 02, 2007, 11:07:15 AM »

Probably not the best way to do this:
Code:
<?php
// Create a canvas with a colour of peachpuff, drawing the rectangle filled lightblue
// add a 10pixel black border, turning the light blue center transparent.
exec("convert -size 650x150 xc:PeachPuff -fill LightBlue -stroke black -strokewidth 10 -draw \"roundRectangle 6,6 627,130 20,20\" -transparent LightBlue mask.png");

// Overlaying the mask made above over the photo
exec("convert imagemagick/original_images/albir.jpg mask.png -geometry +0+0 -composite temp.png");

// Converting the peachpuff canvas to transparent.
exec("convert temp.png -transparent PeachPuff -trim round_border.gif");

unlink'mask.png' );
unlink'temp.png' );
?>



Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
Gold Charm by Shadow82x in association with SMF Themes © 2008
Valid XHTML 1.0! Valid CSS!