Disable text antialias

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
izua
Forum Newbie
Posts: 3
Joined: Tue May 01, 2007 11:16 am

Disable text antialias

Post by izua »

Hi!
I'm working with really small images (32x32/16x16), with low color count.
The script is supposed to take an input image, and output is as a ICO (i have done the conversion script).

The problem is that the antialias generates too many colours.
They (php.net) say that as long as the image isn't truecolor, i can write the negative of the color (ie: put a - before it) so I can disable antialias. Although some small differences appear when I do it, there's still extra colors.

I want to write plain text, with only one color.

Here's what i get with my current script: izua.zephyrhosting.net/test.jpg

How can I disable even this smoothing/antialias/whatever?

Thanks!
Sorayna
Spammer :|
Posts: 7
Joined: Wed Aug 15, 2007 8:10 am

Post by Sorayna »

You can't:)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Disable text antialias

Post by superdezign »

izua wrote:The script is supposed to take an input image, and output is as a ICO (i have done the conversion script).
Likely, the problem is in your conversion. I've dealt with the ICO format, and you have to work with exact colors to get exact results. Create the palette, then use the colors from that palette (imagecolorexact()) to create the image pixel by pixel.
Post Reply