libGD

GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD creates PNG, JPEG and GIF images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve web site development.

See the GD website for more informations.

Tasklist

FS#65 — gdImageSetThickness() has no effect on Anti Aliased Lines

Attached to Project — libGD
Opened by Someone Insignificant (isomeone) - Thursday, 29 March 2007, 23:37 GMT+2
Last edited by Pierre Joye (Pierre) - Thursday, 03 May 2007, 23:57 GMT+2
Task Type Feature Request
Category Drawing function
Status Assigned
Assigned To Pierre Joye (Pierre)
Operating System Linux
Severity Medium
Priority Normal
Reported Version 2.0.34
Due in Version 2.1.0
Due Date Undecided
Percent Complete 60%
Votes 0
Private No

Details

I tried drawing an anti-aliased line with gdImageLine() on a true color image and it worked. The line was anti-aliased. Then I added a call to gdImageSetThickness() just before the call to gdImageLine() and it had no effect. I then changed the color of the line being draw to white and commented out the call to gdImageSetAntiAliased() and the line was drawn at the new thickness, so it appears either a) anti-aliased lines cannot be draw except with a thickness of 1, or b) this is a bug. It would be nice if this were fixed.

This task depends upon

Comment by Pierre Joye (Pierre) - Sunday, 01 April 2007, 22:47 GMT+2
  • Field changed: Task Type (Bug Report → Feature Request)
a) anti-aliased lines cannot be draw except with a thickness of 1, or b) this is a bug. It would be nice if this were fixed.

it is a). Antialias is not supported in primitives when a thickness larger than 1 is used.

We plan to support AA and thickness in 2.1.0. I change the report to a feature request.

Comment by Pierre Joye (Pierre) - Thursday, 03 May 2007, 23:45 GMT+2
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Due in Version (Undecided → 2.1.0)
  • Task assigned to Pierre Joye (Pierre)

See some resulting of my current work on a new set of polygon functions. They add full anti aliasing support (incl. alpha) and support of polygons with holes (like a big O for example), many polygons can be used to construct a complex shapes or a simple trapezoid to draw thick lines.

An example: http://pierre.libgd.org/polygons/

Comment by leo (leo) - Friday, 07 September 2007, 13:20 GMT+2

I just encountered the same problem, when will the 2.1.0 released to solve this issue? I got the up-to-date code from CVS and seems it is still not work for this issus. The test result of polygon drawing you provided at http://pierre.libgd.org/polygons/ is so good, do these polygon functions involved in the up-to-date CVS code ?(seems not)

And I test the 2.0.35 API function gdImagePolygon, but did not get the anti-aliased effect, did i missing something?

gdPoint points[4];
im_out = gdImageCreateTrueColor(256 + 384, 384);
white = gdImageColorAllocate (im_out, 255, 255, 255);
points[0].x = 64;
points[0].y = 128;
points[1].x = 68;
points[1].y = 132;
points[2].x = 132;
points[2].y = 68;
points[3].x = 128;
points[3].y = 64;
gdImageSetAntiAliased (im_out, white);
gdImagePolygon(im_out, points, 4, gdAntiAliased);
//gdImageSetThickness(im_out, 10);
//gdImageLine(im_out, points[0].x, points[0].y, points[1].x, points[1].y, gdAntiAliased);

thanks and regards, leo.


Loading...