Convert drawable to bitmap
<p>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 .</p>

<p>To save the picture i have to convert the Drawable Image with the effect to bitmap </p>

<p>that is for applying the effect to the current image</p>

<pre><code>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);

            }
</code></pre>

<p>And that is for the saving part</p>

<pre><code>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();
</code></pre>

<p>I think the problem is with the part where i convert the Drawable to bitmap as it save it without the effect </p>
