A modern, customizable photo collage editor library for Android built with Jetpack Compose. Create stunning collages with minimal code while maintaining full control over the UI.
| Feature | Description |
|---|---|
| π¨ 15+ Templates | Beautiful layouts for 2-6 images |
| πΌοΈ Built-in Gallery | Permission handling & image selection |
| βοΈ Customizable Styling | Border width, color, corner radius |
| π§ Custom Bars | Full control over TopBar/BottomBar in Gallery & Editor |
| π System Bar Support | Proper status & navigation bar padding |
| π€ Data Return | Returns bitmap + collage data β you handle saving |
| π Gesture Support | Tap to swap, long-press to replace |
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}// build.gradle.kts (app module)
dependencies {
implementation("com.github.samoba-islam:PhotoCollegekit:1.0.0")
}import com.samoba.collagekit.CollageKitEditor
import com.samoba.collagekit.CollageKitConfig
@Composable
fun MyScreen() {
var showEditor by remember { mutableStateOf(false) }
if (showEditor) {
CollageKitEditor(
config = CollageKitConfig(defaultImageCount = 4),
onResult = { result ->
// result.outputBitmap β Generated 1080Γ1080 bitmap
// result.images β List of SlotImageOutput with transforms
saveBitmapToGallery(result.outputBitmap)
showEditor = false
},
onCancel = { showEditor = false }
)
} else {
Button(onClick = { showEditor = true }) {
Text("Create Collage")
}
}
}| Parameter | Type | Default | Description |
|---|---|---|---|
initialImages |
List<SlotImageInput> |
[] |
Pre-loaded images with positions |
defaultTemplateId |
String? |
null |
Template ID to use |
defaultImageCount |
Int |
2 |
Number of images for picker |
showPickerInitially |
Boolean |
true |
Show gallery picker first |
presets |
CollagePresets |
Default | Styling presets |
| Parameter | Type | Default |
|---|---|---|
borderWidth |
Float |
8f |
borderColor |
Int |
0xFFFFFFFF (White) |
cornerRadius |
Float |
0f |
backgroundColor |
Int |
0xFF1A1A2E (Dark) |
CollageKitEditor(
config = CollageKitConfig(
initialImages = listOf(
SlotImageInput(slotIndex = 0, uri = imageUri1),
SlotImageInput(slotIndex = 1, uri = imageUri2, scale = 1.5f)
),
defaultTemplateId = "2_side_by_side",
showPickerInitially = false,
presets = CollagePresets(
borderWidth = 12f,
borderColor = 0xFF000000.toInt(),
cornerRadius = 16f
)
),
onResult = { /* Handle result */ }
)CollageKit provides full customization of both Gallery (image picker) and Editor screens.
| Scope | Properties |
|---|---|
GalleryTopBarScope |
selectedCount, requiredCount, onBack |
GalleryBottomBarScope |
selectedCount, requiredCount, isComplete, onConfirm |
CollageTopBarScope |
collageState, onBack, onDone, isGenerating |
CollageBottomBarScope |
collageState, onDone, isGenerating |
CollageKitEditor(
config = CollageKitConfig(defaultImageCount = 3),
galleryTopBar = {
TopAppBar(
title = { Text("Select $requiredCount Photos") },
subtitle = { Text("$selectedCount selected") },
navigationIcon = {
IconButton(onClick = onBack) {
Icon(Icons.Default.Close, null)
}
}
)
},
galleryBottomBar = {
Surface(modifier = Modifier.navigationBarsPadding()) {
Button(
onClick = onConfirm,
enabled = isComplete,
modifier = Modifier.fillMaxWidth().padding(16.dp)
) {
Text(if (isComplete) "Continue" else "Select ${requiredCount - selectedCount} more")
}
}
},
onResult = { /* ... */ }
)CollageKitEditor(
config = CollageKitConfig(),
editorTopBar = {
TopAppBar(
title = { Text("Edit Collage") },
navigationIcon = {
IconButton(onClick = onBack) { Icon(Icons.Default.ArrowBack, null) }
},
actions = {
if (isGenerating) {
CircularProgressIndicator(Modifier.size(24.dp))
} else {
IconButton(onClick = onDone) { Icon(Icons.Default.Check, null) }
}
}
)
},
onResult = { /* ... */ }
)| Images | Available Templates |
|---|---|
| 2 | Side by Side, Top & Bottom, Focus Left, Focus Right |
| 3 | Featured Top, Featured Bottom, Featured Left, Triptych |
| 4 | Classic Grid, Magazine Left, Hero Top, Mosaic |
| 5 | Center Stage, Cross, Pyramid |
| 6 | Grid 2Γ3, Grid 3Γ2, Magazine |
When the user completes editing, onResult receives a CollageResult:
data class CollageResult(
val template: CollageTemplate, // Template used
val images: List<SlotImageOutput>, // Images with transforms
val borderWidth: Float,
val borderColor: Int,
val cornerRadius: Float,
val backgroundColor: Int,
val outputBitmap: Bitmap // 1080Γ1080 generated image
)Copyright 2026 Samoba
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
See LICENSE for the full text.
Shawon Hossain
- GitHub: @samoba-islam
- Website: samoba.pages.dev
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Made with β€οΈ for the Android community