AmrJyniat
09/03/2025, 12:25 PMBlemdMode.DstOut to erase the black paths in mask from the original image but failed since DstOut works with transparent and opaque not white/black. Could you suggest better solution that lets me erase the black paths while leaving the white in original image as it is?AmrJyniat
09/03/2025, 12:25 PMCanvas(Modifier.fillMaxSize()){
drawContext.canvas.withSaveLayer(
Rect(Offset.Zero, size), Paint()
){
drawImage(image = originalImage)
drawImage(
image = whiteBgBlackPathImage, // mask has white BG with black(opacity) path(s)
blendMode = BlendMode.DstOut
)
}
}romainguy
09/03/2025, 3:33 PMSrc and Dst are all about alpha compositing. The Modulate and Multiply modes should do what you want if you invert the mask (white where you want to keep pixels, black otherwise)romainguy
09/03/2025, 3:33 PM