Jump to content

rounding image corners


jsalita

Recommended Posts

what you want to do is find the corners getimagesize will do this for you.

 

Create a 1x1 pixel (or larger) transparent .png to use as an over lay

 

Figure out the correct corner in proportion to the image size for each corner and then make it a triangle shape to start. get the cordinates of each point on the triangle.

 

Change the hypotenuses of the triangle into a cubic equation (or polar circle) that will "round" the hypotenuses of the triangle.

 

Then once you know which pixels need to get "transparented" either use you 1x1 pixel image on each "square" about 60 times or develop a larger say 4x4 transparent box in addition to the 1x1 and simply "white it out" like a pen stroke.

 

That is my simple idea to do it, odds are there is a better way where you create initially a a transparent image of the original image size and then overlay the original on top of it with its corners "rounded" however I find this version workable in my mind.

Isn't this possible with CSS? I'm pretty sure it is.

 

 

not if you want the physical image to have corners in it instead of using css to mask it.

 

Oh ok. Yeah I just did a quick search and couldn't turn up much. Maybe I was thinking of something else.

 

Stick with using GD and play around with some of the functions it offers.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.