Convert drawable to bitmap
===

I am making an app that load image either via camera or gallery to the app .then have options to apply some effects to the picture e.g Black and white , Negative , Sepia .

To save the picture i have to convert the Drawable Image with the effect to bitmap 

that is for applying the effect to the current image

    if (item.equalsIgnoreCase("Black and white")) {
					Drawable d = new BitmapDrawable(currentimage);
					convertToGrayscale(d);
					blackandwhite = (Bitmap)((BitmapDrawable) d).getBitmap();
					ImageView black_white_imageview = (ImageView) findViewById(com.example.cameraproject.R.id.imageView1);
					black_white_imageview.setImageDrawable(d);

				}


And that is for the saving part

    path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
					File file = new File(path, "name.png");

					FileOutputStream out = new FileOutputStream(file);
					blackandwhite.compress(Bitmap.CompressFormat.PNG, 100, out);
					out.close();
