Thats strange; the code for GD in the example I tried is:
Code: Select all
$canvas = imagecreate( 200, 100 );
$black = imagecolorallocate( $canvas, 0, 0, 0 );
$white = imagecolorallocate( $canvas, 255, 255, 255 );
imagefilledrectangle( $canvas, 9, 9, 189, 89, $white );
$font = "verdana.ttf";
$text = "Title";
$size = "30";
$box = imagettfbbox( $size, 0, $font, $text );
$x = (200 - ($box[2] - $box[0])) / 2;
$y = (100 - ($box[1] - $box[7])) / 2;
$y -= $box[7];
imageTTFText( $canvas, $size, 0, $x, $y, $black, $font, $text );
imagejpeg( $canvas, "Label_GD.jpg" );
ImageDestroy( $canvas );
Code: Select all
$text = "Title";
exec("/usr/local/bin/convert -background white -fill black -pointsize 30 -font verdana.ttf -gravity Center -size 180x80 label:$text -mattecolor black -frame 10x10+0+0 Label_IM.jpg");
Unless you are processing a lot of images the difference is not worth worrying about but I think its an interesting result.
Is it that GD is built into php and ImageMagick is an external program ?