Antialiasing is done on a pixel by pixel basis.  I'm guessing that you don't
want to deal with the lines on that kind of basis, considering that it's a
whole lot of work.  Check the documentation, a lot of graphics
engines/utilities include a way draw antialiased lines.

However, if you're hell bent on doing it yourself, a quick and dirty
solution is to halve the RGB value of the lightest and the darkest pixel
adjacent to the 'edge' of the line.  Or, if you want better results at
double the cost, add two pixels to the line and only drop the RGB value by a
third in each of them.

So, for example, if you were antialiasing a black line to a white page,
black has an RGB value of (255,255,255) or (1,1,1 -- depending on your
graphics suite) and white, of course, is (0,0,0) so the antialiased pixel
would be (127,127,127) and would have a grayish look.  You throw that on the
edge of the line and voila, you have psuedo-antialiasing.

"Jan Maska" <[EMAIL PROTECTED]> wrote in message
> 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?
> Thanx-a-lot,
> J.M. AKA Mac

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to