How to avoid pixelation when resizing (compressing) images on Android?

We resize photos taken by the camera to 1024x768 for download. On most Android devices, our code works fine, but on some they do not (for example, Motorola Photon 4G, Galaxy Nexus, Motorola Droid X2).

We use the code from here: stack overflow

But when this does not work, the resized image looks like this: pixalated

Does anyone know why?

0
source share
1 answer

Android resizes images based on the pixel density of the device it is running on. You need to get the display size and device density in order to understand what Android will try to do with your photo based on viewing its attempt to put the image in

+1
source

Source: https://habr.com/ru/post/1385343/


All Articles