I use the following code to square a bitmap that is rectangular :
private static Bitmap squareBitMap(Bitmap givenBitmap) {
int dim = Math.max(givenBitmap.getWidth(), givenBitmap.getHeight());
Bitmap resultBitmap= Bitmap.createBitmap(dim, dim, Config.ARGB_8888);
Canvas canvas = new Canvas(resultBitmap);
canvas.drawColor(Color.WHITE);
canvas.drawBitmap(givenBitmap, (dim - givenBitmap.getWidth()) / 2, (dim - givenBitmap.getHeight()) / 2, null);
return resultBitmap;
}
And this code to blur a bitmap.
There are many apps in google play that blur and square bitmap like that:
EXAMPLE
how can i achieve that?