If you draw on a canvas, using js ctx.lineJoin = "round"; and then try to do the same on a GD $img the result will not be the same.
Here is a simple code to draw a line similar to one made using lineJoin round.
$w=5; //set your line thickness;
imagesetthickness($img, $w);
imageline($img, $x1, $y1, $x2, $y2, $color);
imagesetthickness($img, 1);
imagefilledellipse ( $img , $x2 , $y2 , $w ,$w, $color);