Currently, mobile developers keep looking for a new method to make image loading run faster. Today, we are going to see the difference between the two most popular image loader library, Picasso and Glide. Both of them may have their own advantage and disadvantage, even though they may look 90% similar. In fact, some resources said that Glide is Picasso-clone. Anyway in details, it is quite different. Especially in several ways below:
Import to Project
compile ‘com.squareup.picasso:picasso:2.5.1’
}
Glide
compile ‘com.github.bumptech.glide:glide:3.5.2’
compile ‘com.android.support:support-v4:22.0.0’
}
Glide also requires Android Support Library v4, so bear in mind to import support-v4 to your project like above as well. Frankly, you basically need Android Support Library v4 in every single new-age Android project, so it should not be kind of problem for you.
Image’s Quality in Details
The image’s quality between the two may not be too different, but Picasso is better known that is has better image quality. As you can see on the images below, Glide has some hard pixels and is not as smooth as the Picasso one and it is difficult to find the straight way to change image resizing algorithm.
Disk Caching
In terms of default disk caching concept, Picasso and Glide are quite different. In the experiment below, the same Full HD image is loaded into ImageView with Picasso and Glide. When I checked the cache folder, it appears that Glide cached the ImageView-size (768×432 pixels) while Picasso cached the full size one (1920×1080 pixels).
If you see closer on the picture above, you will see the hard pixels described above is also there. In addition, if image is loaded in RGB565 mode, the cached image will be also in RGB565.
Moreover, other difference occurs when you try to adjust ImageView to the different sizes. Picasso will cache only single size of image, the full-size one while Glide acts differently, it caches separate file for each size of ImageView. You also need to download an image that has already been loaded if you need to load another size the same image before be resized to the right resolution and then be cached.
Anyway you could use this command to adjust its behavior by let Glide cache both the full-size image and the resized one.
.load(“http://nuuneoi.com/uploads/source/playstore/cover.jpg”) .diskCacheStrategy(DiskCacheStrategy.ALL)
.into(ivImgGlide);
The full-size image would be loaded from cache, resized and then cached, the next time image is requested to show on any ImageView. Due to this, Glide can load and show image faster than Picasso, while Picasso may take longer time to load images since it needs to be resized first before it is set to an ImageView.
GIF
Compared to Picasso, Glide also has an ability to load GIP animation to a simple ImageView which makes it more interesting. However, if you would like to use GIF, you should use it wisely, since it consumes quite a lot of memory. Glide is also able to decode any local video file to a still image.
Furthermore, you can configure the way image appears with an animator (R.animator) while Picasso could do only one animation, fading in.