Nov 16, 2020

ELI5: Fresco - Image Management Library for Android

cover

By Dmitry Vinnik

Originally posted here.

In this post, we explain Fresco, a powerful system for displaying images in Android applications, in a way that is super simple to understand (or as it's commonly known online, ELI5). If you're interested in learning by watching or listening, check out a video about this open source project on our Facebook Open Source Youtube channel.

Why Fresco?

Many of us are accustomed to browsing the Internet using reliable in-home wireless or a high-speed LTE connection on our mobile device. However, many users all over the world don't have access to reliable internet access or the newest phone. With these limitations, users are unable to effectively use photos, gifs, and other forms of media. These non-text based communication devices help people to come across more genuine, and, without them, people's conversations stay more formal and often lack genuine personality.

Fortunately, we get to help these people with projects like Fresco. This resources management library ensures that images, animations, and other visual assets can be used on a wide range of devices, even with an unreliable Internet connection. Fresco makes this happen by keeping resources' memory footprint as small as possible. This functionality lets people use visuals while adjusting the image quality to what the device and the network can handle.

Here's how it works. Fresco introduces progressive image loading where a low-resolution scan of the image is shown first, and then the quality is gradually improved as more of the image gets downloaded. This functionality is especially useful for devices relying on slow networks.

One use case to consider is how we use Fresco at Facebook. As a company, we aim to make online communication more personal. For this purpose, the Facebook app has animated stickers and gifs where people can authentically express themselves. However, from a technical point of view, these animated stickers and gifs are difficult to support as they need to be decoded, stored and displayed. But with Fresco, these challenges are handled for you, so animation becomes what it should be - a lot of fun!

Where is it used?

Fresco was first open sourced in early 2015. Apart from Facebook, companies like Wikipedia, Twitter and Redfin use this library for their Android apps.

Where can I learn more?

To learn more about Fresco, visit their website. It has great documentation for those who are just starting or want to use more advanced features. In case you would like to see Fresco in action, the project's site has multiple sample apps for you to try. If you have any questions, you can go to Fresco's GitHub page or StackOverflow.

If you have any further questions about Fresco, let us know on our Youtube channel, or by tweeting at us. We always want to hear from you and hope you will find this open source project and the new ELI5 series useful.

About the ELI5 series

In a series of short videos (~1 min in length), one of our Developer Advocates on the Facebook Open Source team explains a Facebook open source project in a way that is easy to understand and use.

We will write an accompanying blog post (like the one you're reading right now) for each of these videos, which you can find on our Youtube channel.

To learn more about Facebook Open Source, visit our open source site, subscribe to our Youtube channel, or follow us on Twitter and Facebook.

Interested in working with open source at Facebook? Check out our open source-related job postings on our career page by taking this quick survey.