0

We are using Picasso for image handling on our app and we have been having problems with pixelated images. Unfortunately I have been unable to figure out why this is happening, whether by trying out different combinations of things on Picasso, or trying to find the answer online.

Here is our code for image handling currently (some parameter names changed to be easier to read):

    Picasso.with(image.getContext())
                .load(imageUrl)
                .resize(100, 125)
                .centerCrop()
                .placeholder(R.drawable.image1)
                .error(R.drawable.image2)
                .transform(new RoundedTransformation(10, 4))
                .into(image)

The RoundedTransformation function just gives the images rounded corners and the code for it is here (we did not write this code): https://gist.github.com/aprock/6213395

centerCrop is necessary to prevent the images from being stretched out when they are put into the ImageView.

Does anyone know why pixelation of images might be happening? Thanks and have a great day.

Lauren Q
  • 51
  • 2
  • 2
    You're resizing the image to 100x125 pixels. Is your view actually only 100x125 pixels large? On a high resolution screen, that's about the size of 2 characters of text. – ianhanniballake Nov 26 '16 at 17:05
  • backing @ianhanniballake, i guess you are confused with dp value given in xml file. Dont forget that picasso or glide accepts the values in px not in dp. – Mohammed Atif Nov 26 '16 at 17:32

0 Answers0