Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created January 4, 2026 08:57
Show Gist options
  • Select an option

  • Save skydoves/d502b810a45a14dfe01f916a68dd2b99 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/d502b810a45a14dfe01f916a68dd2b99 to your computer and use it in GitHub Desktop.
Landscapist: Automatic Downsampling
// Without explicit size - calculates from Compose constraints
LandscapistImage(
model = "https://example.com/large-image.jpg",
modifier = Modifier.size(200.dp) // Auto-calculates target size
)
// With explicit size constraint
val request = ImageRequest.builder()
.model(imageUrl)
.size(width = 400, height = 300) // Target size in pixels
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment