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 multiple diff visualizations with varying levels of context preservation.
Your tool should accept two image file paths and produce three different diff outputs, each highlighting changes with different background visibility levels:
Each output should:
diff-high-contrast.png)The tool should handle images with transparency correctly and report dimension mismatches appropriately.
When comparing two identical images, all three diff outputs should show grayscale versions of the original with zero mismatches @test
When comparing images that differ by a few pixels, the high contrast output should show differences on a near-white background, while the context preserved output should maintain full original brightness @test
When image dimensions don't match, an error should be reported @test
/**
* Generates multiple diff visualizations between two images
*
* @param {string} img1Path - Path to first PNG image
* @param {string} img2Path - Path to second PNG image
* @param {string} outputPrefix - Prefix for output filenames
* @returns {Object} Object containing mismatch count and output paths
*/
function generateDiffReport(img1Path, img2Path, outputPrefix) {
// IMPLEMENTATION HERE
}
module.exports = { generateDiffReport };Provides pixel-level image comparison with configurable visualization options.
Provides PNG encoding and decoding support for reading and writing image files.