I'm using this simple function to scale my bitmaps to the same size:
fun resizeImage(file: File) {
val resized = BitmapFactory.decodeFile(file.absolutePath)
if (resized != null) {
val resizedBitmap = Bitmap.createScaledBitmap(
resized, 512, 512, false
)
file.outputStream().use {
resizedBitmap.compress(Bitmap.CompressFormat.WEBP, 100, it)
resizedBitmap.recycle()
}
}
}
Using this function makes the image quality visibly worse, before the images have an resolution of 480x480, scaling them with this function makes the quality like 40% worse.
I got the quality put on 100, what else can I do?