Need private packages and team management tools?Check out npm Teams »

compare-image-data

1.0.1 • Public • Published

Compare Image

A small library to compare ImageData objects.

Install

npm install compare-image-data

API

The library exposes 2 functions at the moment.

isSame(aImageData, bImageData)boolean
isSubset(imageDataImageData, subsetImageData)boolean

Example

import * as compareImage from 'compare-image-data'
 
const imageDataA = new ImageData(10, 10);
const imageDataB = new ImageData(10, 10);
 
compareImage.isSame(imageDataA, imageDataB); // true
 
 
const imageDataC = new ImageData(5, 5);
imageDataA.fill(255);
imageDataC.fill(255);
 
compareImage.isSubset(imageDataA, imageDataC); // true

Look at the tests for more examples.

Install

npm i compare-image-data

DownloadsWeekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar