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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ExpertAlmost
Forum Commoner
Posts: 41
Joined: Mon Oct 20, 2008 12:26 am

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

Post 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!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post by requinix »

Depends how you define "smooth".

No, really, it does.
ExpertAlmost
Forum Commoner
Posts: 41
Joined: Mon Oct 20, 2008 12:26 am

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

Post 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!
ExpertAlmost
Forum Commoner
Posts: 41
Joined: Mon Oct 20, 2008 12:26 am

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

Post 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!
Post Reply