# compare-image-data

> A small library to compare ImageData objects.

Latest version **1.0.1** (published 2017-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install compare-image-data
pnpm add compare-image-data
yarn add compare-image-data
bun add compare-image-data
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-06-13 |
| First published | 2017-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ulrik Strid |
| Maintainers | ulrikaugustsson |
| Keywords | ImageData, compare |

## Links

- npm: https://www.npmjs.com/package/compare-image-data
- npm.io page: https://npm.io/package/compare-image-data

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-06-13
- 1.0.0 — 2017-06-13

## README

# Compare Image

A small library to compare ImageData objects.

## Install

`npm install compare-image-data`

## API

The library exposes 2 functions at the moment.

```ts
isSame(a: ImageData, b: ImageData): boolean
```

```ts
isSubset(imageData: ImageData, subset: ImageData): boolean
```

## Example

```ts
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.

---
_Source: https://npm.io/package/compare-image-data · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
