Back to the snippets index

Alternative rounded corners ( Anthony 23/1/2011 )

Adds the rounded corners to an image without having to know the original image size.
Also uses tempory images in the memory.

IM code:

<?php
$cmd 
" thumbnail.gif \( +clone -alpha extract ".
" \( -size 15x15 xc:black -draw 'fill white circle 15,15 15,0' -write mpr:arc +delete \) ".
" \( mpr:arc \) -gravity northwest -composite ".
" \( mpr:arc -flip \) -gravity southwest -composite ".
" \( mpr:arc -flop \) -gravity northeast -composite ".
" \( mpr:arc -rotate 180 \) -gravity southeast -composite \) ".
" -alpha off -compose CopyOpacity -composite ";

exec("convert $cmd rounded_corners.png");
?>

Image to go with Alternative rounded corners example code
Batch file - windows server
Check size before resizing
Dividing an image
Fonts Installed view
Get image data into a variable 1
Get image data into a variable 2
Gravity option
New image size in variable
Row of images
Setup Information
Use an array
Warhol effect