From afe9bba2c96a42495260795cd7390e3ed0e97d66 Mon Sep 17 00:00:00 2001 From: Kyle Smith Date: Tue, 9 Dec 2025 14:24:23 -0600 Subject: [PATCH 1/2] Add readme --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 774883b..4577b26 100644 --- a/README.md +++ b/README.md @@ -1 +1,44 @@ -# image-diff +# Image Diff + +Real-time image diffing in the browser, powered by WebGL. + +## Installing + +```shell +npm install @rolemodel/image-diff +``` + +or + +```shell +yarn add @rolemodel/image-diff +``` + +## Usage + +```javascript +import ImageDiff from "@rolemodel/image-diff" + +const originalImage = document.getElementById('base-image') +const newImage = document.getElementById('new-image') +const imageDiff = new ImageDiff(originalImage, newImage) + +const result = imageDiff.update({ + diffColor: { r: 1, g: 0, b: 0 }, + diffThreshold: 0.2, + backgroundAlpha: 1.0 +}) + +// result is a canvas element +document.body.appendChild(result) + +imageDiff.dispose() +``` + +Calling `update()` again will re-render the diff. Make sure to call `dispose()` to clean up WebGL resources. + +## Acknowledgments + +**image-diff** is [MIT-licensed](LICENSE), open-source software from [RoleModel Software][https://rolemodelsoftware.com/]. It was initially based on [pixelmatch](https://github.com/mapbox/pixelmatch), using a similar algorithm ported to WebGL. + +[RoleModel Software][rms] is a world-class, collaborative software development team dedicated to delivering the highest quality custom web and mobile software solutions while cultivating a work environment where community, family, learning, and mentoring flourish. From 590615b2b559e019afb54faddc2eda946e06991d Mon Sep 17 00:00:00 2001 From: Kyle Smith Date: Tue, 9 Dec 2025 14:26:20 -0600 Subject: [PATCH 2/2] Fix link to RoleModel --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4577b26..561835b 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ Calling `update()` again will re-render the diff. Make sure to call `dispose()` ## Acknowledgments -**image-diff** is [MIT-licensed](LICENSE), open-source software from [RoleModel Software][https://rolemodelsoftware.com/]. It was initially based on [pixelmatch](https://github.com/mapbox/pixelmatch), using a similar algorithm ported to WebGL. +**image-diff** is [MIT-licensed](LICENSE), open-source software from [RoleModel Software][rms]. It was initially based on [pixelmatch](https://github.com/mapbox/pixelmatch), using a similar algorithm ported to WebGL. [RoleModel Software][rms] is a world-class, collaborative software development team dedicated to delivering the highest quality custom web and mobile software solutions while cultivating a work environment where community, family, learning, and mentoring flourish. + +[rms]: https://rolemodelsoftware.com/