code: public static Bitmap clipCircle(@NonNull final Bitmap bitmap, final int size) {
          Bitmap squareBitmap = clipSquare(bitmap, size);
          int squareSize = squareBitmap.getWidth();
          float radius = (float) squareSize / 2.0f;
          Bitmap clippedBitmap = Bitmap.createBitmap(squareSize, squareSize, Bitmap.Config.ARGB_8888);
          Canvas canvas = new Canvas(clippedBitmap);
          Paint paint = new Paint();
          paint.setAntiAlias(true);
          paint.setColor(Color.BLACK);
          canvas.drawCircle(radius, radius, radius, paint);
          paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
          canvas.drawBitmap(squareBitmap, new Rect(0, 0, squareSize, squareSize),
                  new Rect(0, 0, squareSize, squareSize), paint);
          return clippedBitmap;
      }
docs: Clips the corners of a bitmap in order to transform it into a round shape. Additionally, the
  bitmap is resized to a specific size. Bitmaps, whose width and height are not equal, will be
  clipped to a square beforehand.
  
  @param bitmap
  The bitmap, which should be clipped, as an instance of the class {@link Bitmap}. The
  bitmap may not be null
  @param size
  The size, the bitmap should be resized to, as an {@link Integer} value in pixels. The
  size must be at least 1
  @return The clipped bitmap as an instance of the class {@link Bitmap}