Connecting Tech Pros Worldwide Help | Site Map

turning off antialiasing in imagettftext() does not work

  #1  
Old July 17th, 2005, 09:45 AM
Leif Wessman
Guest
 
Posts: 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

  #2  
Old July 17th, 2005, 09:45 AM
Leif Wessman
Guest
 
Posts: n/a

re: turning off antialiasing in imagettftext() does not work



Leif Wessman wrote:[color=blue]
> From: http://www.php.net/manual/en/function.imagettftext.php
> "color is the color index. Using the negative of a color index has[/color]
the[color=blue]
> 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[/color]
as[color=blue]
> 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[/color]

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.

  #3  
Old July 17th, 2005, 09:53 AM
Shawn Wilson
Guest
 
Posts: n/a

re: turning off antialiasing in imagettftext() does not work



Leif Wessman wrote:[color=blue]
>
> Leif Wessman wrote:[color=green]
> > From: http://www.php.net/manual/en/function.imagettftext.php
> > "color is the color index. Using the negative of a color index has[/color]
> the[color=green]
> > 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[/color]
> as[color=green]
> > stated in the docs the text gets grainy. Not antialised, and not
> > aliased. Something in between (ugly!). I've tried several fonts.[/color][/color]
[color=blue]
> http://www.freewebs.com/leifwessman/test.png
> As you can see, the text is grainy.[/color]

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
shawn@glassgiant.com
http://www.glassgiant.com
  #4  
Old July 17th, 2005, 09:55 AM
Leif Wessman
Guest
 
Posts: n/a

re: turning off antialiasing in imagettftext() does not work



Shawn Wilson wrote:[color=blue]
> Leif Wessman wrote:[color=green]
> >
> > Leif Wessman wrote:[color=darkred]
> > > From: http://www.php.net/manual/en/function.imagettftext.php
> > > "color is the color index. Using the negative of a color index[/color][/color][/color]
has[color=blue][color=green]
> > the[color=darkred]
> > > effect of turning off antialiasing."
> > >
> > > I'm using a bundled version of GD: 2.0.23 compatible. When using[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > function imagettftext() with a negative color to get a aliased[/color][/color][/color]
text[color=blue][color=green]
> > as[color=darkred]
> > > stated in the docs the text gets grainy. Not antialised, and not
> > > aliased. Something in between (ugly!). I've tried several fonts.[/color][/color]
>[color=green]
> > http://www.freewebs.com/leifwessman/test.png
> > As you can see, the text is grainy.[/color]
>
> It looks aliased to me... I think it just looks grainy because it's[/color]
aliased and[color=blue]
> tiny. I think if you make it bigger, the aliasing will become[/color]
apparent.[color=blue]
>
> Shawn
> --
> Shawn Wilson
> shawn@glassgiant.com
> http://www.glassgiant.com[/color]


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

Leif

Closed Thread