GD Alpha Text Outline

Just playing with another ugly layout and i want to use Avenir with GD to create text with an alpha background, that is all accomplished. However, there is an ugly, jaggy white single pixel outline that looks like a bag of crap.

Any idea how to get GD to anti alias, or at least not put out that white?

Heres a link to what i’m working on:
http://joshuajonah.com/joshuajonahv11/

And here’s the GD that i’m using to make the image(s). (it’s also making the subtitles):


<?php
$text = $_GET['title'];
$fontsize = 60;
$height = 90;
$font = 'avenirheavy.otf';
if(isset($_GET['subtitle']) && $_GET['subtitle'] == "true"){
    $fontsize = 30;
    $height = 50;
    $font = 'avenir.otf';
}
$size = imagettfbbox($fontsize, 0, $font, $text);
$width = $size[2] + $size[0]-50;
$im = imagecreatetruecolor($width, $height);
if(isset($_GET['subtitle']) && $_GET['subtitle'] == "true"){
    $white = imagecolorallocate($im, 13, 13, 13);
    $black = imagecolorallocate($im, 255, 255, 255);
}else{
    $white = imagecolorallocate($im, 255, 255, 255);
    $black = imagecolorallocate($im, 13, 13, 13);
}
imagefilledrectangle( $im, 0, 0, $width, $height, $white );
$im2 = imagecolortransparent($im, $white);
$xcoord = -10;
$ycoord = $height - 3;
$array = str_split($text);
$hpos = 0;
for($i=0; $i<count($array); $i++){
    if(isset($_GET['subtitle']) && $_GET['subtitle'] == "true"){
        $bbox = imagettftext( $im, $fontsize, 0, $hpos, $ycoord-12, $black, $font, $array[$i] );
        $hpos = $bbox[2];
    }else{
        $bbox = imagettftext( $im, $fontsize, 0, $hpos, $ycoord, $black, $font, $array[$i] );
        $hpos = $bbox[2]-5;
    }
}
$fileparts = split("[.?]",$text);
$filename="";
for($i=0;$i<count($fileparts);$i++){
    $filename.=$fileparts[$i];
};
imagepng($im, "../img/".$filename.".png");
imagedestroy($im);
echo "img/".$filename.".png";
?>