question: public static byte [ ] bitmapToPng ( final Bitmap image ) { if ( image == null ) return null ; ByteArrayOutputStream ba = new ByteArrayOutputStream ( ) ; if ( image . compress ( CompressFormat . PNG , 100 , ba ) ) return ba . toByteArray ( ) ; else return null ; }
target:  Bitmap into compressed PNG