Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 783 Bytes

File metadata and controls

32 lines (23 loc) · 783 Bytes

BackgroundRemoval-Android

This app removes the background as well as object from the image. It is written using Kotlin.

Usage

Add Gradle dependency:

implementation 'com.github.gabrielbb:cutout:0.1.2'

Getting the result

override fun onActivityResult(requestCode: Int, resultCode: Int, @Nullable data: Intent?) {
        if (requestCode == CUTOUT_ACTIVITY_REQUEST_CODE.toInt()) {

            when (resultCode) {
                Activity.RESULT_OK -> {
                    val imageUri = getUri(data)
                    val bitmap = MediaStore.Images.Media.getBitmap(this.contentResolver, imageUri)

                    imageView.setImageBitmap(bitmap)
                }
            }

        }
    }