I am using the below code to append text on JPEG image...
imagettftext( $png, $size, 0,$textx+2, $texty+2, $shadow_color, $fontfile, $textval );
imagettftext( $png, $size, 0,$textx, $texty, $tx, $fontfile, $textval );
imagejpeg($png, $medium_card_file_path);
imagedestroy($png);
But while trying to do the same thing using gif images, the quality of the animation gets affected.
Thanks in advance for your help.