Re: [GD-DEVEL] trouble with antialiasing
| From: | Eric Tucker | Date: | Tue, 30 Oct 2007 05:58:42 +0000 |
| Subject: | Re: [GD-DEVEL] trouble with antialiasing | ||
| References: | 1 2 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-274@lists.php.net to get a copy of this message | ||
Hi Pierre,
Hmmm, maybe I'm looking at the wrong docs, or the docs need
updating... I was reading http://www.libgd.org/OldDrawing, under
gdImageSetAntiAliased(), and it says "Antialiased lines can be drawn
on both truecolor and palette-based images."
Also, I'm not clear on why the line from the example did not come out
antialiased -- only lines at angles other than 45 degrees seemed to
use any shades other than the exact one I specified. Is this an
artifact of the particular algorithm being used?
thanks,
Eric
On Sat, Oct 27, 2007 at 10:37:52AM +0200, Pierre wrote:
> Hi Eric,
>
> On 10/26/07, Eric Tucker <et@hexagon.tallmaple.com> wrote:
> > Hi,
> >
> > I am having trouble getting even the most basic antialiasing to work.
> > I copied the example right out of the manual and built it in as much
> > isolation as possible, but am still getting a non-antialiased line.
> > My test source file is included below, and I am building it with:
> >
> > gcc -lgd -o gtest gtest.c
> >
> > This is on Fedora Core 6, with gd-2.0.35-1.fc6 and
> > gd-devel-2.0.35-1.fc6.
> >
> > I was able to get it to antialias by both (a) creating the image
> > instead with gdImageCreateTrueColor(), and (b) changing the second
> > 99 to a 49, thus making the line be at less than a 45-degree angle.
> > But these seem arbitrary to me -- I was just thrashing around
> > randomly -- and I don't see why the original code does not work.
> >
> > Am I missing something obvious here?
>
> > im = gdImageCreate(100, 100);
>
> im = gdImageCreateTrueColor(100,100);
>
> Truecolor image has AA support.
>
> Cheers,
> --Pierrre