Page 1 of 1

Graphics Problem: How to draw a really smooth line with PHP

Posted: Thu Sep 10, 2009 11:31 pm
by ExpertAlmost
When using PHP to draw lines or rectangles that are neither horizontal nor vertical, the lines are not smooth. Are there any tricks to getting a really fine-grained, smooth, angled-line in PHP?

As a work-around, I have drawn hundreds of shapes in Corel Draw and exported them as transparent-background PNG files. When I need a shape, I overlay them onto my PHP created image. Which means I have hundreds of static, uniquely named graphics files. There has to be a better way!

Why can I draw and import a smooth-lined rectangle from Corel but can't draw a rectangle as smoothly with PHP?

Soon I will have to change graphic sizes forcing me to redraw and resave all those static images. Nightmare! Being able to dynamically draw my images in PHP would be magnificent. Any and all insights are greatly appreciated.

Thank you!

Re: Graphics Problem: How to draw a really smooth line with PHP

Posted: Fri Sep 11, 2009 12:14 am
by requinix
Depends how you define "smooth".

No, really, it does.

Re: Graphics Problem: How to draw a really smooth line with PHP

Posted: Fri Sep 11, 2009 12:36 am
by ExpertAlmost
Thank you for your reply!

Okay...assuming there are a range of subjective and objective measurements of "smooth," how then would I increase that measurement of smoothness when drawing a non-vertical or non-horizontal line?

I am not at the point of "choosing" a smoothness. I am simply trying to make what I have look better.

Any ideas?

Thank you in advance!

Re: Graphics Problem: How to draw a really smooth line with PHP

Posted: Fri Sep 11, 2009 12:42 am
by ExpertAlmost
I had not considered using any other graphics packages other than the standard. I am concerned that when I port this program up to a server they may not have ImageMagick or GraphicsMagick. What advantages would using ImageMagick or GraphicsMagick provide?

Thank you!