How can we convert bitmap image to byte array in Android without compressing the image? Image to byte array in Android:
Bitmap photo = (Bitmap) data.getExtras().get("data");
img_view.setImageBitmap(photo);
Bitmap resizedImage = Bitmap.createScaledBitmap(photo,512,512 , true);
ByteArrayOutputStream bos = new ByteArrayOutputStream(photo.getWidth()*photo.getHeight());
resizedImage.compress(Bitmap.CompressFormat.PNG,100, bos);
bArray = bos.toByteArray();
Set image size between 300 to 400 kb.