If someone wants to cut from bottom to bottom
// recreate the new Bitmap Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, x, y, width, height, matrix, true);
replace the following parameters with this logic
y: (bitmapOrg.getHeight () - 1) - (the height of the red rectangle is present in the question)
height: (the height of the red rectangle is present in the question)
This way you can avoid exceptions like (for x you need to change accordingly)
IllegalArgumentException: x + width must be <= bitmap.width() in android IllegalArgumentException: y + width must be <= bitmap.height() in android
Swapnil
source share