Picasso v / s Imageloader v / s Fresco vs Glide [關閉]

本文翻譯自:Picasso v/s Imageloader v/s Fresco vs Glide [closed]

Findings: 發現:

  1. Difference between Picasso v/s ImageLoader here ... Picasso v / s ImageLoader的區別在這裏......
  2. Info about the library GLIDE here ... 關於圖書館GLIDE的信息在這裏......
  3. Now recently Facebook released new image library called Fresco 現在最近Facebook發佈了名爲Fresco的新圖像庫

Questions: 問題:

  1. What is the difference between Picasso v/s Imageloader v/s Fresco Picasso v / s Imageloader v / s Fresco有什麼區別
  2. When can we use Glide 我們什麼時候可以使用Glide
  3. Which is the best library to use. 哪個是最好的庫。
  4. If each library has its own significance, what are they ? 如果每個圖書館都有自己的意義,那麼它們是什麼?

#1樓

參考:https://stackoom.com/question/1zCjx/Picasso-v-s-Imageloader-v-s-Fresco-vs-Glide-關閉


#2樓

These answers are totally my opinion 這些答案完全是我的意見

Answers 答案

  1. Picasso is an easy to use image loader, same goes for Imageloader. Picasso是一個易於使用的圖像加載器,同樣適用於Imageloader。 Fresco uses a different approach to image loading, i haven't used it yet but it looks too me more like a solution for getting image from network and caching them then showing the images. Fresco使用不同的圖像加載方法,我還沒有使用它,但它看起來更像是一個從網絡獲取圖像並緩存然後顯示圖像的解決方案。 then the other way around like Picasso/Imageloader/Glide which to me are more Showing image on screen that also does getting images from network and caching them. 然後反過來像Picasso / Imageloader / Glide對我來說更多是在屏幕上顯示圖像,也可以從網絡獲取圖像並緩存它們。

  2. Glide tries to be somewhat interchangeable with Picasso.I think when they were created Picasso's mind set was follow HTTP spec's and let the server decide the caching policies and cache full sized and resize on demand. Glide嘗試與Picasso有些互換。我認爲當它們被創建時,Picasso的思維模式遵循HTTP規範,讓服務器決定緩存策略並緩存完整大小並按需調整大小。 Glide is the same with following the HTTP spec but tries to have a smaller memory footprint by making some different assumptions like cache the resized images instead of the fullsized images, and show images with RGB_565 instead of RGB_8888. Glide與遵循HTTP規範相同,但通過做出一些不同的假設(例如緩存已調整大小的圖像而不是全尺寸圖像)來嘗試擁有更小的內存佔用,並使用RGB_565而不是RGB_8888顯示圖像。 Both libraries offer full customization of the default settings. 兩個庫都提供默認設置的完全自定義。

  3. As to which library is the best to use is really hard to say. 至於哪個庫最好用,真的很難說。 Picasso, Glide and Imageloader are well respected and well tested libraries which all are easy to use with the default settings. Picasso,Glide和Imageloader是備受推崇的,經過良好測試的庫,所有這些庫都可以使用默認設置輕鬆使用。 Both Picasso and Glide require only 1 line of code to load an image and have a placeholder and error image. Picasso和Glide都只需要1行代碼來加載圖像並具有佔位符和錯誤圖像。 Customizing the behaviour also doesn't require that much work. 自定義行爲也不需要那麼多工作。 Same goes for Imageloader which is also an older library then Picasso and Glide, however I haven't used it so can't say much about performance/memory usage/customizations but looking at the readme on github gives me the impression that it is also relatively easy to use and setup. 同樣適用於Imageloader,它也是一個較舊的庫,然後是Picasso和Glide,但是我沒有使用它所以不能說很多關於性能/內存使用/自定義,但是看看github上的自述文件給我的印象是它也是相對容易使用和設置。 So in choosing any of these 3 libraries you can't make the wrong decision, its more a matter of personal taste. 因此,在選擇這三個庫中的任何一個時,您都無法做出錯誤的決定,更多的是個人品味。 For fresco my opinion is that its another facebook library so we have to see how that is going to work out for them, so far there track record isn't that good. 對於壁畫我的意見是它的另一個facebook庫,所以我們必須看看它將如何爲他們解決,到目前爲止,跟蹤記錄並不是那麼好。 Like the facebook SDK is still isn't officially released on mavenCentral I have not used to facebook sdk since sept 2014 and it seems they have put the first version online on mavenCentral in oct 2014. So it will take some time before we can get any good opinion about it. 就像facebook SDK還沒有在mavenCentral上正式發佈 我從2014年9月開始就沒有用過facebook sdk了,似乎他們已經在2014年10月將第一個版本放到mavenCentral上了。所以我們需要一些時間才能獲得任何很好的意見。

  4. between the 3 big name libraries I think there are no significant differences. 我認爲3個大牌庫之間沒有顯着差異。 The only one that stand out is fresco but that is because it has a different approach and is new and not battle tested. 唯一脫穎而出的是壁畫,但那是因爲它採用了不同的方法而且是新的而不是經過戰鬥測試。


#3樓

I am one of the engineers on the Fresco project. 我是Fresco項目的工程師之一。 So obviously I'm biased. 顯然我有偏見。

But you don't have to take my word for it. 但你不必接受我的話。 We've released a sample app that allows you to compare the performance of five libraries - Fresco, Picasso, UIL, Glide, and Volley Image Loader - side by side. 我們發佈了一個示例應用程序,可以讓您比較五個庫的性能--Fresco,Picasso,UIL,Glide和Volley Image Loader - 並排。 You can get it at our GitHub repo . 你可以在我們的GitHub回購中獲得它。

I should also point out that Fresco is available on Maven Central, as com.facebook.fresco:fresco . 我還應該指出,Fresco可以在Maven Central上獲得,如com.facebook.fresco:fresco

Fresco offers features that Picasso, UIL, and Glide do not yet have: Fresco提供Picasso,UIL和Glide尚未提供的功能:

  1. Images aren't stored in the Java heap, but in the ashmem heap. 圖像不存儲在Java堆中,而是存儲在ashmem堆中。 Intermediate byte buffers are also stored in the native heap. 中間字節緩衝區也存儲在本機堆中。 This leaves a lot more memory available for applications to use. 這爲應用程序留下了更多可用內存。 It reduces the risk of OutOfMemoryErrors. 它降低了OutOfMemoryErrors的風險。 It also reduces the amount of garbage collection apps have to do, leading to better performance. 它還減少了應用程序必須執行的垃圾回收量,從而提高了性能。
  2. Progressive JPEG images can be streamed, just like in a web browser. 漸進式JPEG圖像可以流式傳輸,就像在Web瀏覽器中一樣。
  3. Images can be cropped around any point, not just the center. 圖像可以在任何點周圍裁剪,而不僅僅是中心。
  4. JPEG images can be resized natively. JPEG圖像可以原生調整大小。 This avoids the problem of OOMing while trying to downsize an image. 這樣可以避免在嘗試縮小圖像尺寸時出現OOMing問題。

There are many others ( see our documentation ), but these are the most important. 還有很多其他的( 參見我們的文檔 ),但這些是最重要的。


#4樓

Mind you that this is a highly opinion based question, so I stopped making fjords and made a quick table 請注意,這是一個基於意見的問題,因此我不再製作峽灣並快速製作表格

在此輸入圖像描述

Now library comparison is hard because on many parameters, all the four pretty much do the same thing, except possibly for Fresco because there is a whole bunch of new memory level optimizations in it.So let me know if certain parameters you'd like to see a comparison for based on my experience. 現在庫比較很難,因爲在許多參數上,所有這四個幾乎都做同樣的事情,除了Fresco,因爲它有一大堆新的內存級別優化。所以讓我知道你是否想要某些參數根據我的經驗看一個比較。

Having used Fresco the least, the answer might evolve as I continue to use and understand it for current exploits. 最少使用Fresco後,答案可能會隨着我繼續使用並在當前漏洞利用中理解它而發展。 The used personally is having used the library atleast once in a completed app. used personally使用的是在已完成的應用程序中至少使用過一次庫。

*Note - Fresco now supports GIF as well as WebP animations *注意 - Fresco現在支持GIF和WebP動畫


#5樓

Neither Glide nor Picasso is perfect. 格萊德和畢加索都不是完美的。 The way Glide loads an image to memory and do the caching is better than Picasso which let an image loaded far faster. Glide將圖像加載到內存並進行緩存的方式比Picasso更好,後者可以更快地加載圖像。 In addition, it also helps preventing an app from popular OutOfMemoryError. 此外,它還有助於防止應用程序受歡迎的OutOfMemoryError。 GIF Animation loading is a killing feature provided by Glide. GIF動畫加載是Glide提供的殺戮功能。 Anyway Picasso decodes an image with better quality than Glide. 無論如何,畢加索解碼的圖像質量比Glide更好。

Which one do I prefer? 我更喜歡哪一個? Although I use Picasso for such a very long time, I must admit that I now prefer Glide. 雖然我使用畢加索這麼長時間,但我必須承認我現在更喜歡格萊德。 But I would recommend you to change Bitmap Format to ARGB_8888 and let Glide cache both full-size image and resized one first. 但我建議你將位圖格式更改爲ARGB_8888,然後讓Glide緩存全尺寸圖像並先調整大小。 The rest would do your job great! 剩下的就是你的工作!

  • Method count of Picasso and Glide are at 840 and 2678 respectively. Picasso和Glide的方法計數分別爲840和2678。
  • Picasso (v2.5.1)'s size is around 118KB while Glide (v3.5.2)'s is around 430KB. 畢加索(v2.5.1)的大小約爲118KB,而Glide(v3.5.2)的大小約爲430KB。
  • Glide creates cached images per size while Picasso saves the full image and process it, so on load it shows faster with Glide but uses more memory. Glide爲每個尺寸創建緩存圖像,而Picasso保存完整圖像並對其進行處理,因此在加載時,它會更快地顯示Glide但使用更多內存。
  • Glide use less memory by default with RGB_565 . 使用RGB_565 Glide默認使用更少的內存。

+1 For Picasso Palette Helper . +1爲畢加索調色板助手

There is a post that talk a lot about Picasso vs Glide post 有一篇文章談論畢加索與格萊德的帖子


#6樓

Fresco sources | Fresco 來源 | off site 場外
(-) ( - )
- Huge size of library - 圖書館規模龐大
- No Callback with View, Bitmap parameters - 沒有使用View,Bitmap參數的回調
- SimpleDraweeView doesn't support wrap_content - SimpleDraweeView不支持wrap_content
- Huge size of cache - 巨大的緩存大小
(+) (+)
- Pretty fast image loader (for small && medium images) - 非常快的圖像加載器(適用於小型和中型圖像)
- A lot of functionality(streaming, drawing tools, memory management, etc) - 許多功能(流媒體,繪圖工具,內存管理等)
- Possibility to setup directly in xml (for example round corners) - 可以直接在xml中設置(例如圓角)
- GIF support - GIF支持
- WebP and Animated Webp support - WebP和Animated Webp支持


Picasso sources | 畢加索 來源 | off site 場外
(-) ( - )
- Slow loading big images from internet into ListView - 慢速將大圖像從互聯網加載到ListView中
(+) (+)
- Tinny size of library - 圖書館的大小
- Small size of cache - 小尺寸的緩存
- Simple in use - 使用簡單
- UI is not freeze - UI不凍結
- WebP support - WebP支持


Glide sources 滑翔

(-) ( - )
- Big size of library - 大型圖書館
(+) (+)
- Tinny size of cache - Tinny大小的緩存
- Simple in use - 使用簡單
- GIF support - GIF支持
- WebP support - WebP支持
- Fast loading big images from internet into ListView - 快速將大圖像從互聯網加載到ListView
- UI is not freeze - UI不凍結
- BitmapPool to re-use memory and thus lesser GC events - BitmapPool重用內存,從而減少GC事件


Universal Image Loader sources 通用圖像加載器

(-) ( - )
- Limited functionality (limited image processing) - 功能有限(圖像處理有限)
- Project support has stopped since 27.11.2015 - 項目支持自2015年11月27日起停止
(+) (+)
- Tinny size of library - 圖書館的大小
- Simple in use - 使用簡單


Tested by me on SGS2 (Android 4.1) (WiFi 8.43 Mbps) 我在SGS2(Android 4.1)上測試(WiFi 8.43 Mbps)
Official versions for Java, not for Xamarin! Java的官方版本,不適用於Xamarin!
October 19 2015 2015年10月19日

I prefer to use Glide. 我更喜歡使用Glide。
Read more here . 在這裏閱讀更多。
How to write cache to External Storage (SD Card) with Glide. 如何使用Glide 將緩存寫入外部存儲(SD卡)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章