https://github.com/apify/actor-imagediff
Returns an image containing difference of two given images.
https://github.com/apify/actor-imagediff
Last synced: 3 months ago
JSON representation
Returns an image containing difference of two given images.
- Host: GitHub
- URL: https://github.com/apify/actor-imagediff
- Owner: apify
- License: apache-2.0
- Created: 2018-10-18T08:26:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T00:49:10.000Z (over 3 years ago)
- Last Synced: 2025-06-30T07:06:11.970Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 815 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# actor-imagediff
Returns an image containing difference of two given images. Internally uses [pixelmatch](https://www.npmjs.com/package/pixelmatch#pixelmatchimg1-img2-output-width-height-options) NPM package and supports all of its options.
Input consists of 2 images (PNG or JPEG) and other optional parameters:
```json
{
"imageUrl1": "https://raw.githubusercontent.com/mapbox/pixelmatch/master/test/fixtures/4a.png",
"imageUrl2": "https://raw.githubusercontent.com/mapbox/pixelmatch/master/test/fixtures/4b.png",
"outputAsJpeg": false,
"pixelmatchOptions": { "threshold": 0.1 }
}
```
Default output is an PNG image containing diff of given images. Using options `outputAsJpeg: true` the result my be switched to JPEG format. Parameter `pixelmatchOptions` may contain any parameters supported by [pixelmatch](https://www.npmjs.com/package/pixelmatch#pixelmatchimg1-img2-output-width-height-options) NPM package.
This actor can be used as [synchronous API](https://www.apify.com/docs/api/v2#/reference/actors/run-actor-synchronously/with-input) that returns diff image as response to POST request.
Source images
Diff