Programmatically radius image
Currently our website department have a process where they manually radius the corners of each images to +4% to create "nicer" looking images for the 开发者_JAVA百科web.
They currently do this using the radius function of Serif Photoplus, I was hoping people could think of a way to do this programmatically to a whole folder of images ideally using open source or free tools.
I'm aware we could do the radiusing with CSS, but I have yet to be convinced that there is an easy way to do this that is effective across all browsers and legacy browsers although I'm open to options in regard to this.
I think ImageMagick would be the right tool for the job.
This thread explains how to make rounded corners on images. It seems there are many ways to do this, this is why I listed no particular solution here. ImageMagick also has a batch function, with that you can apply the corner rounding to all the images in a directory.
ImageMagick is distributed under the Apache 2.0 license, so you can use it freely for commercial purposes.
You could do it by hand, creating a mask and then adding the images.
Example in Mathematica:
id = ImageDimensions;
ImageAdd[#,
Rasterize[
Graphics[Rectangle[{0, 0}, id@#, RoundingRadius -> Max@id@#/25],
PlotRange -> Transpose@{{0, 0}, id@#}],
ImageSize -> id@#]] &@
Import@"http://tutor-atlanta.com/wp-content/uploads/2010/11/test2.jpg"
精彩评论