An Android library for image annotation
- Freehand and shape-based drawing
- Undo/Redo/Clear support
- Configurable brush color and size
- Zoom and pan gestures
- Easy-to-use toolbar component
- Jetpack Compose integration
dependencies {
implementation("com.github.karya-inc:chitralekhan:<latest_release>")
}
dependencies {
implementation 'com.github.karya-inc:chitralekhan:<latest_release>'
}
val chitraLekhan = rememberChitraLekhan(
image = bitmap,
drawMode = DrawMode.FreeHand,
color = colors.random(),
width = 1f
)
ChitraLekhanCanvas(
chitraLekhan = chitraLekhan,
modifier = Modifier.fillMaxSize()
)
var isColorPickerVisible by remember { mutableStateOf(false) }
ChitraLekhanToolbar(
colors = colors,
pickedColor = chitraLekhan.strokeColor.value,
isColorPickerVisible = isColorPickerVisible,
onColorPickerClicked = { isColorPickerVisible = !isColorPickerVisible },
onColorPicked = {
chitraLekhan.setColor(it)
isColorPickerVisible = false
},
drawMode = chitraLekhan.drawMode.value,
onDrawModeSelected = chitraLekhan::setDrawMode,
onClear = chitraLekhan::clear,
onUndo = chitraLekhan::undo,
onRedo = chitraLekhan::redo,
modifier = Modifier
.clip(RoundedCornerShape(16.dp, 16.dp, 0.dp, 0.dp))
.background(MaterialTheme.colorScheme.surfaceContainer)
.padding(8.dp),
brushSize = chitraLekhan.strokeWidth.value,
onBrushSizeChange = chitraLekhan::setWidth
)
Configuration | Values |
---|---|
DrawMode | FreeHand |
Circle |
|
Polygon(val sides: Int) |
|
Rectangle |
|
None (for pan/zoom only) |
Check out the Sample App for a working example.

Inspired by:
- DrawFull
- Image Annotation Tool for Karya Android App