docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a tool that compares two images and generates a transparent overlay showing only the differences, which can be composited onto any background.
Your tool should accept two PNG image files and produce a transparent overlay image where:
The tool should handle images with transparency and be suitable for creating difference visualizations in design tools or documentation.
/**
* Generates a transparent overlay showing only the differences between two images.
*
* @param {string} imagePath1 - Path to the first PNG image
* @param {string} imagePath2 - Path to the second PNG image
* @param {string} outputPath - Path where the transparent overlay PNG will be saved
* @returns {Promise<number>} The number of differing pixels
* @throws {Error} If images have different dimensions or cannot be read
*/
async function generateDiffOverlay(imagePath1, imagePath2, outputPath) {
// IMPLEMENTATION HERE
}
module.exports = { generateDiffOverlay };Provides pixel-level image comparison capabilities.
Provides PNG image encoding and decoding support.