Be carefull to check if your image.getDrawable() can actually be cast to BitmapDrawable (to avoid ClassCastExceptions).
If, for instance, you use layers in your image then this snippet will be slightly different: Bitmap bitmap = ((BitmapDrawable)((LayerDrawable)image.getDrawable()).getDrawable(0)).getBitmap();
image.getDrawable()
can actually be cast toBitmapDrawable
(to avoidClassCastExceptions
).Bitmap bitmap = ((BitmapDrawable)((LayerDrawable)image.getDrawable()).getDrawable(0)).getBitmap();