title: Saving circle cropped image as JPEG format, background is not transparent in Android
body: <p>My requirement is, need to crop the image in circle shape and save as new image. For that, i have cropped the bitmap image using DrawRoundRect method of canvas in Android.</p>
  <p>After cropped the image as circle and saving in PNG format, image background is transparent. But if i saved in JPEG format, image background was black. Please find my code</p>
  <pre><code>RoundedBitmap(Bitmap bitmap)
      {
          Bitmap roundBitmap = Bitmap.CreateBitmap(bitmap.Width, bitmap.Height, Bitmap.Config.Argb8888);
          Canvas canvas = new Canvas(roundBitmap);
          Paint paint = new Paint();
          paint.AntiAlias = true;
          RectF rectF = new RectF(0, 0, bitmap.Width, bitmap.Height);
          canvas.DrawRoundRect(rectF, bitmap.Width / 2, bitmap.Height / 2, paint);
           
          paint.SetXfermode(new PorterDuffXfermode(PorterDuff.Mode.SrcIn));
          canvas.DrawBitmap(bitmap, 0, 0, paint);
          return roundedBitmap;
      }
  </code></pre>
  <p>Using <strong>canvas.drawColor(Color.WHITE);</strong> not helped. I need transparent background color for JPEG format. Is it possible.?</p>
  <p>Regards,</p>
  <p>Bharathi.</p>