title: Rounded corners using ImageMagick (bakground transparent or white)
body: <p>I'm trying to add rounded corners to my images using ImageMagick.</p>
  
  <p>If the input image is a PNG or GIF file my script is working correctly.</p>
  
  <p>But if my input file is a JPEG file, the corners are black. I'd like to use a custom corner color in that case (ex. white) any idea ?</p>
  
  <p>Here's my working bash script :</p>
  
  <pre><code>convert -size "$W"x"$H" xc:none -draw "roundrectangle 0,0,$W,$H,$R,$R" $MASK
  convert $SRC -matte $MASK -compose DstIn -composite $DST
  </code></pre>
  
  <p>Parameters are :</p>
  
  <p>$SRC : the input image
  $W : width of input image
  $H : height of input image
  $MASK : the mask image which contains transparent corners
  $DST : the resulting image with rounded corners.</p>
  
  <p>Thanks in advance.</p>