[ Web Proxy ]
URL:
Viewing: http://developer.android.com/develop/ui/compose/graphics/images/loading [Back]  [Original]

Loading images  |  Jetpack Compose  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]

Loading images Stay organized with collections Save and categorize content based on your preferences.

Load an image from the disk

Use the Image composable to display a graphic on screen. To load an image (for example: PNG, JPEG, WEBP) or vector resource from the disk, use the painterResource API with your image reference. You don't need to know the type of the asset, just use painterResource in Image or paint modifiers.

DrawScope:

Image(
    painter = painterResource(id = R.drawable.dog),
    contentDescription = stringResource(id = R.string.dog_content_description)
)

To ensure that your app is accessible, supply a contentDescription for visual elements on screen. TalkBack reads out the content description, so you must ensure that the text is meaningful if read out loud and translated. In the preceding example, a stringResource() is used to load up the translated content description from the strings.xml file. If your visual element on screen is purely for visual decoration, set your contentDescription to null for the screen reader to ignore it.

If you need lower-level ImageBitmap specific functionality, you can use ImageBitmap.imageResource() to load up a Bitmap. For more information on ImageBitmaps, read the ImageBitmap versus ImageVector section.

Drawable support

painterResource supports the following drawable types:

Load an image from the internet

To load an image from the internet, there are several third-party libraries available to help you handle the process. Image loading libraries do a lot of the heavy lifting for you; they handle both caching (so you don't download the image multiple times) and networking logic to download the image and display it on screen.

For example, to load an image with Coil from Instacart, add the library to your gradle file, and use an AsyncImage to load an image from a URL:

AsyncImage(
    model = "https://example.com/image.jpg",
    contentDescription = "Translated description of what the image contains"
)

An image loading library backed by Kotlin Coroutines (Instacart).

A fast and efficient image loading library for Android focused on smooth scrolling (Google).

Additional resources

Overview
ImageBitmap vs ImageVector

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-14 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-14 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page