views:

656

answers:

6
+1  Q: 

Rounded Corners

Hello,

I am wondering whats the best way to programmatically make rounded corners for images. This can be either using PHP or javascript. An algorithm will also do for the same and I can code it with Image::Magick or GD.

Thank you for your time.

+1  A: 

Well, it depends what exactly you need. Do you want the corners to be transparent, or filled in some color? Which image format?

Here is some help for making rounded corners: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=8401

Check it out, and if it does not help, update your question with the specific problem. Then we can probably help :-):

sleske
+1  A: 

use JavaScript to programatically get round corners

OR

you can use mozilla and safaris browser extensions to get round corners using CSS but it will work only in Mozilla and Safari

-moz-border-radius: 5px;
-webkit-border-radius: 5px;
Rony
That automatically make it a nonviable solution, seeing that 90+% users are still using the buggy crap that is IE
futureelite7
Make that 65.80% [http://en.wikipedia.org/wiki/Usage_share_of_web_browsers#Present_to_1999] (or, in any case, something around that number). Also, IE8, hopefully starting to gain users, seems to be less loaded with problems.
Tiberiu Ana
This Comment is to : futureelite.Dont contractdict yourself. If 90+% of people are using it, how come it could be buggy crap! I know IE has some defects but it is really getting better.
Shiva
+1  A: 

I'd use curvy corners or nifty cube

Chris Klepeis
Curvy corners FTW! :DNifty corners can't always round in IE. I have tried it in the Drupal's primary menu but it doesn't work in IE.
marknt15
bloated library. 55.9kb !!!DD_roundies is so much smarter, and lightweight.
vsync
+1  A: 

You can use the above mention tags with CSS, and for IE, use DDRoundies with some jquery code to make it work in IE. It is what I had to do to get it working. Good example of this is http://swiftmailer.org/ site. they make use of what I mentioned.

Aduljr
+2  A: 

My favourite is Liquid Canvas. It's a jQuery plugin.

<div id="rounded">Test</div>

...

$('#rounded').liquidCanvas(
 '[shadow border gradient] => roundedRect{radius:50}');

Take a look at the demo page for more examples.

Paolo Moretti
+1  A: 

Here are links for two PHP based solutions:

  1. Apply rounded corners to images is a PHP script that embeds rounded corner on the image itself
  2. PHP rounded corner generator script generates four corners that you can place over your image using CSS positioning -- or you can use them in your CSS/HTML layouts that require boxes with round corner.
Salman A
thanks. solution 1 was exactly what i needed: a way to generate rounded images that were just images afterwards with no tricky css or javascript.
Steve