The Image Composable
Draw a drawable resource on screen.
The Image Composable is a free Jetpack Compose Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Jetpack Compose Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Pictures, the Compose Way
Every app shows pictures, and in Compose you draw them with the Image composable. It is the declarative replacement for the old ImageView. 🖼️
You Need a Painter
Image does not take a raw resource id. It takes a painter, a small object that knows how to draw your picture onto the screen.
painterResource Loads Drawables
To turn a drawable in res into a painter, you call painterResource with its resource id. This reads your PNG or vector asset.
val logo = painterResource(id = R.drawable.logo)Your First Image
Pass that painter to Image and it appears on screen. This single line draws your drawable wherever the composable sits.
Image(painter = painterResource(R.drawable.logo), contentDescription = null)contentDescription Is Required
Image always asks for a contentDescription. Screen readers speak it aloud, so describe the picture in a few clear words.
Image(painter = logo, contentDescription = "Company logo")Decorative? Pass null
If a picture is purely decorative and adds no meaning, set contentDescription to null so TalkBack skips it instead of reading noise.
Vectors Scale Cleanly
Compose loves vector drawables. A vector stays razor sharp at any size because it is math, not fixed pixels, so it never looks blurry.
Size It with a Modifier
An Image draws at the bitmap size by default. Add a Modifier.size to make it exactly the dimensions your layout needs.
Image(painter = logo, contentDescription = null, modifier = Modifier.size(96.dp))Bitmaps from the Network
painterResource only handles local assets. For remote URLs you reach for a loader library, the most popular being Coil with rememberAsyncImagePainter.
Tinting an Image
You can recolor a simple image with a colorFilter. This is great for monochrome icons you want to match your theme color.
Image(painter = logo, contentDescription = null,
colorFilter = ColorFilter.tint(Color.Blue))Image vs Icon
Use Image for photos and rich artwork. For small, theme-tinted symbols, the lighter Icon composable is usually the better choice.
Quick Check
Which argument does the Image composable always require alongside the painter?
Recap: Drawing Images
You learned that Image draws a painter from painterResource, always needs a contentDescription, and sizes with a modifier. Next up: Material icons! ✨
Frequently asked questions
Is the “The Image Composable” lesson free?
Yes — the full text of “The Image Composable” is free to read here on the web, and the Jetpack Compose Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Jetpack Compose Academy course, upgrade to CoddyKit PRO.
What will I learn in “The Image Composable”?
Draw a drawable resource on screen. You practise Jetpack Compose Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Jetpack Compose Academy?
No prior experience is required. Jetpack Compose Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Image Composable” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Jetpack Compose Academy lesson?
Yes. Every Jetpack Compose Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Image Composable
- Material Icons with Icon
- ContentScale & Cropping
- Clip & Shape Your Images