# Building a sub-sampling image viewer for Compose UI

DevFeed: [Building a sub-sampling image viewer for Compose UI](<https://devfeed.tech/articles/building-a-sub-sampling-image-viewer-for-compose-ui-29021.md>)

Original publisher: [Read original article](<https://saket.me/compose-sub-sampling-image-viewer/>)

Author: Saket Narayan

Published: 2023-08-09T21:07:52Z

Content type: tutorial

Language: en

Sources: [Saket Narayan](<https://devfeed.tech/sources/saket-narayan.md>)

Topics: [Compose](<https://devfeed.tech/topics/compose.md>), [Android](<https://devfeed.tech/topics/android.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [4k](<https://devfeed.tech/tags/4k.md>), [android](<https://devfeed.tech/tags/android.md>), [building](<https://devfeed.tech/tags/building.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-ui](<https://devfeed.tech/tags/compose-ui.md>), [deep](<https://devfeed.tech/tags/deep.md>), [developers](<https://devfeed.tech/tags/developers.md>), [display](<https://devfeed.tech/tags/display.md>), [image](<https://devfeed.tech/tags/image.md>), [library](<https://devfeed.tech/tags/library.md>), [loading](<https://devfeed.tech/tags/loading.md>), [memory](<https://devfeed.tech/tags/memory.md>), [ui](<https://devfeed.tech/tags/ui.md>), [zoom](<https://devfeed.tech/tags/zoom.md>)

## AI overview

An Android developer describes building Telephoto, a zoomable image viewer for Compose UI. The article explains sub-sampling and tiling techniques for displaying large images while reducing memory usage.

## Source excerpt

How do you display a 100mb image on Android without running into OutOfMemoryError? You can't. But you can cheat. For years Android developers have used Dave Morrissey's excellent library, subsampling-scale-image-view for displaying large bitmaps with deep zoom. It optimizes memory usage by loading lower resolution bitmaps whenever possible and avoiding loading parts of the original [...] The post Building a sub-sampling image viewer for Compose UI appeared first on Saket Narayan.