From: Timothy Hunter Date: 2005-04-07T10:34:41+09:00 Subject: Re: RMagick question Joe Van Dyk wrote: > Hi, > > I'd like to generate a thumbnail of an image. The thumbnail should > have curved corners (corners colored a specified color). Any ideas on > what functions I could use? > > Thanks, > Joe > > You might try this approach. Start by making a thumbnail from your image with #resize or #thumbnail. Use Image.new to construct a second image the same size as the thumbnail. Specify the color you want as the background color. Use #roundrectangle in the Draw class to draw a rounded rectangle on the image. Specify the stroke and fill colors as "none" or "transparent". Use #composite with the Magick::OverCompositeOp argument to composite this image over the thumbnail. Give me a shout if you want and I'll see if I can put together an example that does this. If you want the corners to be transparent instead of some specific color, check out the vignette example in the examples/ subdirectory or the "Add transparency with a mask" example in the RMagick portfolio at http://rmagick.rubyforge.org.