I have pixel-art style images stored in res/drawable with their naturally small scale, but meant to be scaled up for display. However the default behaviour seems to be to blur the upscaled image to try and hide the pixels. How can that be disabled?


I see there is a similar question for the old Android framework, but I'm using Jetpack Compose.
There is now a a filterQuality parameter you can set to None in the Image composable to disable bilinear interpolation. This is since version 1.1.0-alpha01 of androidx.compose.ui:ui.
Example usage:
Image(
bitmap = ImageBitmap.imageResource(id = imageId),
contentDescription = null,
filterQuality = FilterQuality.None
)
Workarounds for older versions are mentioned here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With