a-x-/image-diff-view


Compares images (written with vanilla js), inspired by Github's image diff view modes. Demo: http://mxtnr.ru/image-diff-view/,

https://www.npmjs.com/package/image-diff-view

License: MIT

Language: JavaScript


image-diff-view

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

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

Gif image diff view swipe demo Gif image diff view fade demo

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 and demo.

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()
<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

Project Statistics

Sourcerank 5
Repository Size 493 KB
Stars 15
Forks 1
Watchers 2
Open issues 5
Dependencies 0
Contributors 1
Tags 7
Created
Last updated
Last pushed

Top Contributors See all

Alexander

Packages Referencing this Repo

image-diff-view
Compares images, inspired by Github's image diff view modes
Latest release 1.2.0 - Updated - 15 stars

Recent Tags See all

v1.2.0 May 16, 2016
v1.1.1 May 15, 2016
v1.1.0 May 15, 2016
v1.0.4 May 15, 2016
v1.0.3 May 15, 2016
1.0.2 May 15, 2016
1.0.1 May 15, 2016

Something wrong with this page? Make a suggestion

Last synced: 2024-03-21 21:38:06 UTC

Login to resync this repository