# image-diff-view

> Compares images, inspired by Github's image diff view modes

Latest version **1.2.0** (published 2016-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-diff-view
pnpm add image-diff-view
yarn add image-diff-view
bun add image-diff-view
```

## 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.2.0 |
| Published | 2016-05-16 |
| First published | 2016-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Alexander Mextner |
| Maintainers | invntrm |
| Keywords | image, visual, diff, view, github, compare, onion, skin, difference |

## Links

- npm: https://www.npmjs.com/package/image-diff-view
- Repository: https://github.com/a-x-/image-diff-view
- Homepage: https://github.com/a-x-/image-diff-view#readme
- Issues: https://github.com/a-x-/image-diff-view/issues
- npm.io page: https://npm.io/package/image-diff-view

## 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.2.0 (latest) — 2016-05-16
- 1.1.1 — 2016-05-15
- 1.1.0 — 2016-05-15
- 1.0.4 — 2016-05-15
- 1.0.3 — 2016-05-15
- 1.0.2 — 2016-05-15
- 1.0.1 — 2016-05-15
- 1.0.0 — 2016-05-15

## README

# image-diff-view
Compares images, inspired by Github's [image diff view modes](https://github.com/blog/817-behold-image-view-modes).

Inspered by https://github.com/cezary/react-image-diff also ([Demo](http://cezary.github.io/react-image-diff/)).

![Gif image diff view swipe demo](https://github.com/cezary/react-image-diff/raw/master/public/img/demo-swipe.gif)
![Gif image diff view fade demo](https://github.com/cezary/react-image-diff/raw/master/public/img/demo-fade.gif)

## Modes
* `difference` (classic diff)
* `fade` (onion skin)
* `swipe`

## Usage
Controls are not delivery out of the box.
You are free to implement your unique diff controls.

`npm install image-diff-view`

Checkout [example](https://github.com/a-x-/image-diff-view/blob/master/example/index.html) and [demo](https://github.com/a-x-/a-x-.github.io/blob/master/image-diff-view/index.html).

```js
import ImageDiff from 'image-diff-view';

var beforeUrl = 'http://cezary.github.io/react-image-diff/public/img/spot-the-difference-a.jpg',
    afterUrl = 'http://cezary.github.io/react-image-diff/public/img/spot-the-difference-b.jpg';

var imageDiff = new ImageDiff(document.getElementById('image-diff'), beforeUrl, afterUrl, 'swipe');
imageDiff.swipe(0.5);
imageDiff.update(beforeUrl, afterUrl, 'fade');
imageDiff.fade(0.8);
imageDiff.tune(0.4); // abstract tune method rather than fade/swipe()
```
```html
<div class='image-diff' id='image-diff'>
  <div class='image-diff__inner'>
    <div class='image-diff__before'><img/></div>
    <div class='image-diff__wrapper'><div class='image-diff__after'><img/></div></div>
  </div>
</div>
```

## Dependencies
No dependencies required

## Our users
* Yandex

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