0

I am converting, bitmap to jpeg using

val file = File(filePath)
val fos = FileOutputStream(file)
profileImageBitmap.compress(Bitmap.CompressFormat.JPEG,100,fos)

The jpeg looks okay. But its very tiny. I thought it was the jpeg lossy nature but when I tried to convert bitmap into png, it also came down to same size. Is there a way to increase the size of jpeg, compressed from bitmap?

User
  • 1,186
  • 4
  • 22
  • 36

1 Answers1

0

You can use createScaledBitmap to scale up your bitmap before converting to jpeg, try passing true as the filter boolean to get better results. (You might want to decode the bitmap from the file first).

createScaledBitmap documentation

Community
  • 1
  • 1
brunoschalch
  • 41
  • 1
  • 2