# Picasso

Picasso is an Android image downloading and caching library that loads images into applications and handles common image-loading tasks.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Callback leaks: cancel your Picasso requests!

DevFeed: [Callback leaks: cancel your Picasso requests!](<https://devfeed.tech/articles/callback-leaks-cancel-your-picasso-requests-25620.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/callback-leaks-cancel-your-picasso-requests>)

Author: Pierre-Yves Ricau

Published: 2023-01-17T21:06:14Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Picasso](<https://devfeed.tech/topics/picasso.md>), [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [performance](<https://devfeed.tech/tags/performance.md>), [picasso](<https://devfeed.tech/tags/picasso.md>)

### AI overview

This article investigates an Android memory leak caused by an in-flight Picasso image-loading request retaining a detached UI component through a custom callback. It explains how to read the leak trace and recommends canceling requests or using tags when the UI goes away.

### Source excerpt

👋 Hi, this is P.Y., I work as an Android Engineer at Block. Every month I organize an internal Ensemble Leak Hunting session where we look at the top leaks reported by LeakCanary to learn how to read

## Slope-intercept library design

DevFeed: [Slope-intercept library design](<https://devfeed.tech/articles/slope-intercept-library-design-20972.md>)

Original publisher: [Read original article](<https://jakewharton.com/slope-intercept-library-design/>)

Published: 2022-04-05T00:00:00Z

Content type: opinion

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [Picasso](<https://devfeed.tech/topics/picasso.md>), [Android](<https://devfeed.tech/topics/android.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Scala](<https://devfeed.tech/topics/scala.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [http](<https://devfeed.tech/tags/http.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [library](<https://devfeed.tech/tags/library.md>), [picasso](<https://devfeed.tech/tags/picasso.md>)

### AI overview

The article proposes using slope-intercept form as a way to evaluate library design. The intercept represents the initial learning and setup cost, while the slope represents how complexity changes as requirements grow. It compares Picasso, Retrofit, and Dagger to show how libraries can trade a low initial barrier for steeper long-term complexity, or require more conceptual investment up front to remain easier to extend.

### Source excerpt

The equation y=mx+b defines a line in slope-intercept form. The line will intercept the y-axis at the value b and for each change in x its slope (the amount the line goes up or down) will change by m. Slope-intercept gives me a way to think about the design of libraries in relation to each other. The intercept is the initial cost of learning and setup for a library, and the slope is how the library's complexity changes over time. There's no real units here and the values are entirely subjective. Let's try it! Picasso Exactly 10 years ago today I introduced Picasso internally at Square. As an image loading library for Android, its primary selling point was a low intercept. It required no real configuration and only one line of code (even in a ListView adapter). Picasso.with(context).load("https://...").into(imageView); At the time this was a refreshing change from the existing libraries which required a lot of up-front and per-request configuration. The downside, however, was that as your needs grow the slope of complexity also grows faster than desired. Configuring the global instance, managing multiple instances, intercepting requests, and transforming images are all possible but more difficult than if the library was designed differently. Retrofit Retrofit is a declarative HTTP client abstraction for the JVM and Android. It requires configuration of a central object before you can use it to create instances of service interfaces. interface GitHubService { @GET("users/{user}/repos") Call<List<Repo>> listRepos(@Path("user") String user); } var retrofit = new Retrofit.Builder() .baseUrl("https://api.github.com/") .addConverter(MoshiJsonConverter.create()) .build(); var service = retrofit.create(GitHubService.class); This up-front configuration gives Retrofit a higher intercept on the y-axis. Exposure to these APIs gives you an entrypoint to discover functionality and encourages you to manage their lifetimes in an efficient way for your usage allowing the slope of com

## Combining Picasso with color matrices to transform images

DevFeed: [Combining Picasso with color matrices to transform images](<https://devfeed.tech/articles/welcome-to-the-color-matrix-15957.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/welcome-to-the-color-matrix>)

Author: P-Y Ricau

Published: 2015-12-09T17:10:00Z

Content type: tutorial

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Picasso](<https://devfeed.tech/topics/picasso.md>), [Canvas](<https://devfeed.tech/topics/canvas.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [canvas](<https://devfeed.tech/tags/canvas.md>), [code](<https://devfeed.tech/tags/code.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [images](<https://devfeed.tech/tags/images.md>), [picasso](<https://devfeed.tech/tags/picasso.md>), [pixel](<https://devfeed.tech/tags/pixel.md>), [rgb](<https://devfeed.tech/tags/rgb.md>)

### AI overview

This tutorial explains how to tint downloaded images dynamically by converting them to grayscale and applying a ColorMatrix while drawing them on a canvas. It presents the approach as more generic and efficient than layering a translucent color or processing every pixel individually.

### Source excerpt

Combining Picasso with color matrices to transform images.

## Coercing Picasso To Play With Palette

DevFeed: [Coercing Picasso To Play With Palette](<https://devfeed.tech/articles/coercing-picasso-to-play-with-palette-20923.md>)

Original publisher: [Read original article](<https://jakewharton.com/coercing-picasso-to-play-with-palette/>)

Published: 2014-10-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>)

Topics: [Picasso](<https://devfeed.tech/topics/picasso.md>), [Image](<https://devfeed.tech/topics/image.md>), [API](<https://devfeed.tech/topics/api.md>), [Library](<https://devfeed.tech/topics/library.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [image](<https://devfeed.tech/tags/image.md>), [library](<https://devfeed.tech/tags/library.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [picasso](<https://devfeed.tech/tags/picasso.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>)

### AI overview

This article explores how to adapt Picasso's existing APIs to work with the Palette library before direct support is available. It focuses on Bitmap handling, callback behavior, and Picasso's threading model for performing Palette computation without blocking the Android main thread.

### Source excerpt

Features feel how I imagine children would. They are relatively easy to spawn but require a lengthy committment and constant care. Picasso's API would be nothing short of a Greek tragedy if we humored every feature request that we received. Finding the right balance of what is appropriate to add and what isn't is a constant struggle. When the Palette library was teased the inevitable feature request came in to Picasso for a means of supporting it. This was certainly not an unreasonable request, and while we might not explicitly support it directly we will probably add something in the future to more easily facilitate its use. But what do we do in the interim? The API for proper support is many months if not a year away from actually being implemented. Let's walk through an attempt to adapt the existing APIs to allow Palette's use. The fundamental component of Picasso's data pipeline after the request has been fulfilled is a Bitmap. We use this in the return values and method parameters which traverse upwards to the main thread. Bitmap is a final class in Android so we will not get an opportunity to hang extra metadata on a subclass. There are two ways that Picasso can notify the caller of a successful image download: the Callback when loading directly into an ImageView or the more generalized Target. A Target is given direct access to the Bitmap object but the Callback is not (although you can get it indirectly with some cleverness). Regardless of Bitmap access is the problem that both of these are called on the main thread. Since Palette does a decent amount of computation we don't want to do it here anyways. Palette actually has an asynchronous mode of operation that we could leverage in these two callback locations but you wouldn't want to. The images are ready to be displayed when the callbacks are invoked so either delaying display until you can run Palette on another background thread or displaying the image right away and getting the Palette information later

## Picasso 2.3 Adds Request Replaying and New APIs

DevFeed: [Picasso 2.3 Adds Request Replaying and New APIs](<https://devfeed.tech/articles/hello-picasso-2-3-15672.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/hello-picasso-2-3>)

Author: Square Engineering

Published: 2014-05-30T16:06:00Z

Content type: release

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>), [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Picasso](<https://devfeed.tech/topics/picasso.md>), [Android](<https://devfeed.tech/topics/android.md>), [android-development](<https://devfeed.tech/topics/android-development.md>), [Caching](<https://devfeed.tech/topics/caching.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [apis](<https://devfeed.tech/tags/apis.md>), [caching](<https://devfeed.tech/tags/caching.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [picasso](<https://devfeed.tech/tags/picasso.md>), [release](<https://devfeed.tech/tags/release.md>)

### AI overview

Picasso 2.3 introduces request replaying and new APIs for image downloading and caching on Android. Its dispatcher can track failed image requests and automatically replay them when network connectivity returns.

### Source excerpt

Request replaying and new APIs

## Enhance Your Application Using Picasso

DevFeed: [Enhance Your Application Using Picasso](<https://devfeed.tech/articles/enhance-your-application-using-picasso-15627.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/enhance-your-application-using-picasso>)

Author: Square Engineering

Published: 2013-05-14T16:03:00Z

Content type: release

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>), [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Picasso](<https://devfeed.tech/topics/picasso.md>), [Android](<https://devfeed.tech/topics/android.md>), [Library](<https://devfeed.tech/topics/library.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Image](<https://devfeed.tech/topics/image.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [caching](<https://devfeed.tech/tags/caching.md>), [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [image](<https://devfeed.tech/tags/image.md>), [library](<https://devfeed.tech/tags/library.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [picasso](<https://devfeed.tech/tags/picasso.md>)

### AI overview

Square introduces Picasso, an open-source Android library for downloading, caching, displaying, and transforming images. The library is designed to be fast and simple to use, and it uses memory and disk caching to speed bitmap loading.

### Source excerpt

A fluent image downloading and caching library for Android.

## Bezier Curves and Picasso

DevFeed: [Bezier Curves and Picasso](<https://devfeed.tech/articles/bezier-curves-and-picasso-40317.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2013/05/11/bezier-curves-and-picasso/>)

Published: 2013-05-11T00:32:05Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [math](<https://devfeed.tech/topics/math.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Picasso](<https://devfeed.tech/topics/picasso.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [art](<https://devfeed.tech/tags/art.md>), [bezier-curves](<https://devfeed.tech/tags/bezier-curves.md>), [de-casteljau](<https://devfeed.tech/tags/de-casteljau.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [interactive](<https://devfeed.tech/tags/interactive.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [math](<https://devfeed.tech/tags/math.md>), [painting](<https://devfeed.tech/tags/painting.md>), [picasso](<https://devfeed.tech/tags/picasso.md>), [polynomials](<https://devfeed.tech/tags/polynomials.md>), [programming](<https://devfeed.tech/tags/programming.md>), [svg](<https://devfeed.tech/tags/svg.md>)

### AI overview

This tutorial explains Bezier curves through the mathematical ideas behind parameterized curves, then presents a simple algorithm and JavaScript implementation for drawing them. It applies the method to recreate one of Pablo Picasso's line drawings as a sequence of Bezier curves.

### Source excerpt

Pablo Picasso Simplicity and the Artist Some of my favorite of Pablo Picasso's works are his line drawings. He did a number of them about animals: an owl, a camel, a butterfly, etc. This piece called "Dog" is on my wall: Dachshund-Picasso-Sketch (Jump to interactive demo where we recreate "Dog" using the math in this post) These paintings are extremely simple but somehow strike the viewer as deeply profound. They give the impression of being quite simple to design and draw.