Dubcanada Posted July 29, 2009 Share Posted July 29, 2009 Hello, I am trying to create a signature generator and I've got all of it done but the actual genetator part. Here is the problem. I have about 40 gifs (240x20) that I want to right username, and stats onto using imagefttext. I want to use the color white or another color choosen by them. I have everything showing up fine, and it all looks fine EXCEPT the text color is different on every single image and it is only white on one. honlabs.com/SignatureBar/sig.php for example, it's orange. Now if I change the image to honlabs.com/SignatureBar/bgs/chronos.gif it will be white. But if I change it to honlabs.com/SignatureBar/bgs/madman.gif it will be redish gray. Basically the color of the little icon. How do I make it white on ALL images? Also, how could I remove AA from imagefttext. If I make it small enough it doesn't show anything but I don't want it to be size 7. - Steve Link to comment https://forums.phpfreaks.com/topic/168057-problem-with-imagefttext/ Share on other sites More sharing options...
fooDigi Posted July 29, 2009 Share Posted July 29, 2009 could you post some of your code? Link to comment https://forums.phpfreaks.com/topic/168057-problem-with-imagefttext/#findComment-886388 Share on other sites More sharing options...
Dubcanada Posted July 29, 2009 Author Share Posted July 29, 2009 <?php // show the correct header for the image type header("Content-type: image/gif"); // an email address in a string $string = "Dub"; $string2 = "W 21 L 32 K 122 D 3 A 32"; // lets begin by creating an image $im = imagecreatefromgif("bgs/blacksmith.gif"); $w = imagecolorallocate($im, 255,255,255); // some variables to set $font = "fonts/pf_tempesta_seven_condensed.ttf"; $font2 = "fonts/pf_tempesta_seven_condensed_bold.ttf"; imagettftext($im, "6", "0", "60", "16", $w, $font2, $string); imagettftext($im, "6", "0", "90", "16", $w, $font, $string2); // and display imagegif ($im); ?> Link to comment https://forums.phpfreaks.com/topic/168057-problem-with-imagefttext/#findComment-886392 Share on other sites More sharing options...
fooDigi Posted July 30, 2009 Share Posted July 30, 2009 just a thought, but maybe those are the closest colors available within the gif palette, since you are creating from a gif... when you export your gifs, try and include the entire palette of 256 colors... Link to comment https://forums.phpfreaks.com/topic/168057-problem-with-imagefttext/#findComment-886402 Share on other sites More sharing options...
Dubcanada Posted July 30, 2009 Author Share Posted July 30, 2009 Didn't work, but thanks for the suggestion. Link to comment https://forums.phpfreaks.com/topic/168057-problem-with-imagefttext/#findComment-886489 Share on other sites More sharing options...
fooDigi Posted July 30, 2009 Share Posted July 30, 2009 k, i got it to work... instead of creating from gif, i use "imagecreatetruecolor" to create a container, and i also create an image resource of your gif ... then copied them together... here is the code if interested, figure i would just post it rather then explain it... but see if it works for you... Oh, and change the image and font paths first.... header("Content-type: image/gif"); // an email address in a string $string = "Dub"; $string2 = "W 21 L 32 K 122 D 3 A 32"; // lets begin by creating an image $container = imagecreatetruecolor(240, 25); $im = imagecreatefromgif("dubcanada/blacksmith.gif"); imagecopy($container, $im, 0, 0, 0, 0, 240, 25); $w = imagecolorallocate($container, 255,255,255); // some variables to set $font = "dubcanada/pf_tempesta_seven_condensed.ttf"; $font2 = "dubcanada/pf_tempesta_seven_condensed_bold.ttf"; imagettftext($container, "8", "0", "60", "16", $w, $font2, $string); imagettftext($container, "8", "0", "90", "16", $w, $font, $string2); // and display imagegif ($container); Link to comment https://forums.phpfreaks.com/topic/168057-problem-with-imagefttext/#findComment-886498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.