Skip to content

jossephus/android-odiff

Repository files navigation

Android Odiff


Android Odiff is an android image diffing library based on the fast image comparision library [odiff](https://github.com/dmtrKovalenko/odiff)


Android Odiff in Android Project

For now, android-odiff exposes a single function only odiff_diff which takes the path of 2 images to compare and the path of the output image file. The output is automatically saved at the given output path.

import com.jossephus.android_diff.CDiffOptions
import com.jossephus.android_diff.ODiffLib

val options = CDiffOptions()

val resultCode = ODiffLib.odiff_diff(
    beforePath, // 1st image path
    afterPath, // 2nd image path
    context.cacheDir.resolve("diff_output.png").absolutePath, // ouput path
    options
)

You can checkout the sample app in the repo to see how it is used.

Including it in your android apps

  1. Make sure jitpack is added to your top level build.gradle.kts
dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}
  1. You can now pull android-diff In app level build.gradle.kts using
implementation("com.github.jossephus:android-odiff:v0.0.2")

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐

About

Image Diffing Android library based on https://github.com/dmtrKovalenko/odiff

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •