I have a bitmap captured from taking photo in android. The photo is in Bitmap. I have to convert this bitmap into JPEG without any loss. I tried the below code,
val file = File(filePath)
profileImageBitmap.compress(Bitmap.CompressFormat.JPEG,100,FileOutputStream(file))
but when I set the jpeg image using RoundedBitmapFactoryDrawable, the captured image is very small. I want to the exact bitmap to jpeg. Can someone help me with this? Thanks.