About this tool
How to use it
- Choose this tool.
- Add the first picture in the first box.
- Add the second picture in the second box.
- Choose how sensitive the check should be, then press Generate.
- Read the scores and download the picture that marks the differences.
What you get back
Try Compare Images in the Studio
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/images/compare" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'imageA=@photo.jpg' \
-F 'imageB=@photo.jpg' \
-F 'threshold=0.1' \
-F 'alpha=0.1' \
-F 'max_diff_ratio=0'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.compare({
"imageA": 'photo.jpg',
"imageB": 'photo.jpg',
"threshold": 0.1,
"alpha": 0.1,
"max_diff_ratio": 0
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->compare([
'imageA' => 'photo.jpg',
'imageB' => 'photo.jpg',
'threshold' => 0.1,
'alpha' => 0.1,
'max_diff_ratio' => 0,
]);
echo $result->requestId;