Rounded corners when size unknown
Rounded corners when size unknown
i know many posts here deal with rounded transperent corners, and i read most of them, but all of them assume then the width/height are known and im dealing with special case where they are unknown, i can only use 1 commandline, so i cant use identify, is there any way of doing this ?
Re: Rounded corners when size unknown
This is from a post a while ago - uses polygons but can be changed to use radii.
Code: Select all
convert input.jpg ( +clone -threshold -1 -draw "fill black polygon 0,0 0,30 30,0 fill white circle 30,30 30,0" ( +clone -flip ) -compose Multiply -composite ( +clone -flop ) -compose Multiply -composite ) +matte -compose CopyOpacity -composite output.png");
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Rounded corners when size unknown
That example and more is in IM examples...
Thumbnails, Adding Fluff, Rounded Corners
http://www.imagemagick.org/Usage/thumbnails/#rounded
The other technique, requiring the width and height of the image was an older method involving the use of the draw rounded rectangle method. It is also in the above, but is used for adding a border with rounded corners. That is you not only need to cut out the corners, but overlay an outline or frame. See Thumbnails, Framing Techniques, Border with Rounded Corners
http://www.imagemagick.org/Usage/thumbn ... ded_border
Also see the final example on that page...
Lighting Effects -- Glass Bubble
http://www.imagemagick.org/Usage/thumbnails/#lighting
This not only rounds the corners but add both light and dark shading effects to make it look like the image is in a 'glass bubble'.
Thumbnails, Adding Fluff, Rounded Corners
http://www.imagemagick.org/Usage/thumbnails/#rounded
The other technique, requiring the width and height of the image was an older method involving the use of the draw rounded rectangle method. It is also in the above, but is used for adding a border with rounded corners. That is you not only need to cut out the corners, but overlay an outline or frame. See Thumbnails, Framing Techniques, Border with Rounded Corners
http://www.imagemagick.org/Usage/thumbn ... ded_border
Also see the final example on that page...
Lighting Effects -- Glass Bubble
http://www.imagemagick.org/Usage/thumbnails/#lighting
This not only rounds the corners but add both light and dark shading effects to make it look like the image is in a 'glass bubble'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/