By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

turning off antialiasing in imagettftext() does not work

P: n/a

From: http://www.php.net/manual/en/function.imagettftext.php
"color is the color index. Using the negative of a color index has the
effect of turning off antialiasing."

I'm using a bundled version of GD: 2.0.23 compatible. When using the
function imagettftext() with a negative color to get a aliased text as
stated in the docs the text gets grainy. Not antialised, and not
aliased. Something in between (ugly!). I've tried several fonts.
What could be wrong?

Leif

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Leif Wessman wrote:
From: http://www.php.net/manual/en/function.imagettftext.php
"color is the color index. Using the negative of a color index has the effect of turning off antialiasing."

I'm using a bundled version of GD: 2.0.23 compatible. When using the
function imagettftext() with a negative color to get a aliased text as stated in the docs the text gets grainy. Not antialised, and not
aliased. Something in between (ugly!). I've tried several fonts.
What could be wrong?

Leif


This is my code. As you can see there is nothing special about it:

<?
header("Content-type: " . image_type_to_mime_type (IMAGETYPE_PNG));
$im = imagecreate(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

imagettftext($im, 10, 0, 10, 20, -$black, "verdanab.ttf", "Testing...
Omega");
imagepng($im);
imagedestroy($im);
?>

This is the output of the script:

http://www.freewebs.com/leifwessman/test.png
As you can see, the text is grainy.

Jul 17 '05 #2

P: n/a

Leif Wessman wrote:

Leif Wessman wrote:
From: http://www.php.net/manual/en/function.imagettftext.php
"color is the color index. Using the negative of a color index has the
effect of turning off antialiasing."

I'm using a bundled version of GD: 2.0.23 compatible. When using the
function imagettftext() with a negative color to get a aliased text

as
stated in the docs the text gets grainy. Not antialised, and not
aliased. Something in between (ugly!). I've tried several fonts.

http://www.freewebs.com/leifwessman/test.png
As you can see, the text is grainy.


It looks aliased to me... I think it just looks grainy because it's aliased and
tiny. I think if you make it bigger, the aliasing will become apparent.

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #3

P: n/a

Shawn Wilson wrote:
Leif Wessman wrote:

Leif Wessman wrote:
From: http://www.php.net/manual/en/function.imagettftext.php
"color is the color index. Using the negative of a color index has
the
effect of turning off antialiasing."

I'm using a bundled version of GD: 2.0.23 compatible. When using
the function imagettftext() with a negative color to get a aliased
text as
stated in the docs the text gets grainy. Not antialised, and not
aliased. Something in between (ugly!). I've tried several fonts.

http://www.freewebs.com/leifwessman/test.png
As you can see, the text is grainy.


It looks aliased to me... I think it just looks grainy because it's

aliased and tiny. I think if you make it bigger, the aliasing will become apparent.
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

I've tried making it bigger. I've tried different fonts. Same result.
It shouldn't look that way... Something is wrong.

Leif

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.