Forum Moderators: coopster

Message Too Old, No Replies

Help about GD

         

mamylo

5:17 am on Mar 12, 2011 (gmt 0)

10+ Year Member



Hey my friends
I have a GIF image with 2 colors, white and transparent.
For example it's a white circle in center of image, with transparency around that circle.
Now I want to make a border around that circle with php GD library (sth like Stroke in Photoshop), can I do that? How?

Thanks in advance and sorry about my bad English

rainborick

4:06 pm on Mar 12, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It might be possible to import your original graphic file and then draw the border around your circle using the imageelipse() function. I have not done much work with transparency in GD, so I cannot give you any example code.

It might be easier to create a new image file using ImageMagick if it is installed on your server. ImageMagick has direct support for fill and stroke colors and makes it easy to create an image with a transparent background.

mamylo

11:38 pm on Mar 12, 2011 (gmt 0)

10+ Year Member



Dear rainborick, I cannot use imageelipse because the content of the image is not exactly a circle :(

rainborick

4:07 pm on Mar 13, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's too bad. I think you will have to use a program like Photoshop to draw your border. It might be possible to do it with a PHP script, but I think it would be more difficult to write the script than it would be to use a program like Photoshop. Good luck!