QA Image Comparison is a powerful library for comparing images, designed to aid in quality assurance processes. It provides utilities to compare images provided as base64 strings, from file paths, or directly using Jimp objects. With easy-to-use methods a
npm install qa-image-comparisonQA Image Comparison is a library for comparing images, designed for quality assurance purposes. It leverages the Jimp library to provide utilities for comparing images provided as base64 strings, from file paths, or directly using Jimp objects.

You can install the library via npm:
``bash`
npm install qa-image-comparison
typescript
import { CompareImages } from 'qa-image-comparison';const comparer = new CompareImages();
`
$3
`typescript
const image1Base64 = '...'; // Base64 string of the first image
const image2Base64 = '...'; // Base64 string of the second imageconst result = await comparer.CompareImagesByBase64String(image1Base64, image2Base64);
console.log('Images match:', result);
`
$3
`typescript
const imagePath1 = 'path/to/image1.jpg';
const imagePath2 = 'path/to/image2.jpg';const result = await comparer.CompareImagesFromDisk(imagePath1, imagePath2);
console.log('Images match:', result);
`
$3
`typescriptimport Jimp from 'jimp';
const image1 = await Jimp.read('path/to/image1.jpg');
const image2 = await Jimp.read('path/to/image2.jpg');
const result = await comparer.CompareJimpImages(image1, image2);
console.log('Images match:', result);
``Compares two images provided as base64 strings.
imageExpectedString: Base64 string of the expected image.
imageActualString: Base64 string of the actual image to be compared.
Returns a Promise resolving to true if images match, false otherwise.
#### CompareImagesFromDisk(imageExpectedPath: string, imageActualPath: string): Promise
Compares images from file paths.
imageExpectedPath: Path to the expected image file.
imageActualPath: Path to the actual image file to be compared.
Returns a Promise resolving to true if images match, false otherwise.
#### CompareJimpImages(imageExpected: Jimp, imageActual: Jimp): Promise
Compares two Jimp images directly.
imageExpected: The expected Jimp image.
imageActual: The actual Jimp image to be compared.
Returns true if images match, false otherwise.