Re: Antialiasing with GD..?
| From: | Rasmus Lerdorf | Date: | Thu, 13 Dec 2001 17:26:48 +0000 |
| Subject: | Re: Antialiasing with GD..? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77615@lists.php.net to get a copy of this message | ||
The jpgraph graphing package written in PHP has such an anti-aliasing line
draw routine written in PHP and it isn't actually that slow. Check it out
at http://www.aditus.nu/jpgraph/
-Rasmus
On Thu, 13 Dec 2001, Phil Driscoll wrote:
> On Wednesday 12 December 2001 8:35 am, Jan Maska wrote:
> > Hi,
> > I have the following problem:
> >
> > Using the database, I create a graph like __.------._.--._/\.__
> > In order to keep exact colors and prevent a JPEG detail distortion, I use
> > PNG format as output.
> > This has one disadvantage: all lines are rough and I don't know how to
> > antialias them.
> >
> > Can anyone help?
>
> I've never done this in PHP but clearly writing your own antialiased line
> drawing algorithm in PHP will most likely produce something which runs too
> slowly, so you need to do what you can in external libraries.
>
> I would draw the line into a bitmap which was exactly twice the size required
> and then scale the image back to the correct size when you've done with
> imagecopyresampled.
>
> Cheers
>
>