cvat/tests/cypress/plugins/compareImages/addPlugin.js

16 lines
389 B
JavaScript
Raw Permalink Normal View History

2025-09-16 01:19:40 +00:00
// Copyright (C) 2021-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
const Jimp = require('jimp');
async function compareImages(args) {
const imgBase = await Jimp.read(args.imgBase);
const imgAfterChanges = await Jimp.read(args.imgAfterChanges);
const diff = Jimp.diff(imgBase, imgAfterChanges);
return diff.percent;
}
exports.compareImages = compareImages;