You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we us this code with normal image it works fine
**
* Uses the detected segmentation mask to overlay the background image
*/
fun generateMaskBgImage(image: Bitmap, bg: Bitmap): Bitmap {
val bgBitmap = Bitmap.createBitmap(image.width, image.height, image.config)
for (y in 0 until maskHeight) {
for (x in 0 until maskWidth) {
val bgConfidence = ((1.0 - maskBuffer.float) * 255).toInt()
var bgPixel = bg.getPixel(x, y)
bgPixel = ColorUtils.setAlphaComponent(bgPixel, bgConfidence)
bgBitmap.setPixel(x, y, bgPixel)
}
}
maskBuffer.rewind()
return mergeBitmaps(image, bgBitmap)
}
}
however when we try to merge it with transparent image it creates a black background instead of transparent background how can we merge and keep background transparent.
The text was updated successfully, but these errors were encountered:
how to merge with Transparent image
When we us this code with normal image it works fine
**
* Uses the detected segmentation mask to overlay the background image
*/
fun generateMaskBgImage(image: Bitmap, bg: Bitmap): Bitmap {
val bgBitmap = Bitmap.createBitmap(image.width, image.height, image.config)
}
however when we try to merge it with transparent image it creates a black background instead of transparent background how can we merge and keep background transparent.
The text was updated successfully, but these errors were encountered: