Skip to content

Commit 6f859bd

Browse files
committed
Update documentation
1 parent 893d4c0 commit 6f859bd

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

README.md

+15-24
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ODiff is a blazing fast native image comparison tool. Check [benchmarks](#benchm
3030
- ✅ Supports comparison of images with different layouts
3131
- ✅ Using [YIQ NTSC
3232
transmission algorithm](http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf) to determine visual difference
33-
-Requires only [libpng](http://www.libpng.org/pub/png/libpng.html) which is a part of most unix system by default
33+
-No dependencies for `.png` comparison.
3434

3535
### Coming in the nearest future:
3636

@@ -81,7 +81,7 @@ NodeJS Api is pretty tiny as well. Here is a typescript interface we have:
8181
```ts
8282
type ODiffOptions = {
8383
/** Output full diff image. */
84-
diffImage: boolean;
84+
outputDiffMask: boolean;
8585
/** Do not compare images and produce output if images layout is different. */
8686
failOnLayoutDiff: boolean;
8787
/** Color difference threshold (from 0 to 1). Less more precise. */
@@ -104,7 +104,7 @@ Compare option will return `{ match: true }` if images are identical. Otherwise
104104
105105
## Installation
106106

107-
> ⛔️ **for windows users** ⛔️ It is required to install http://www.libpng.org/pub/png/libpng.html manually. But there is a great chance that it was already installed by some other program.
107+
We provide prebuilt binaries for most of the used platforms, there are a few ways to install them:
108108

109109
### Cross-platform
110110

@@ -124,22 +124,13 @@ odiff --help
124124

125125
### lib* dependencies
126126

127-
Make sure that this library depends on the system `lib{png,jpg,gif}` libraries to encode/decode images. They are optional, so if you are running comparison of only `.png` files – only `libpng` is required.
128-
129-
Make sure that appropriate dependencies are installed on your system. Especially when you are running odiff on CI or in Docker.
130-
131-
#### Ubuntu
132-
133-
For Ubuntu 18.04+ [there is no lib* deps preinstalled](https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html) so it will be required to run the docker.
134-
135-
```
136-
apt-get install -y libpng12-0
137-
```
138-
127+
Make sure if you want to compare **other** than `.png` images it is required to install the proper C library for each format. For `.jpg` – [libjpg](http://libjpeg.sourceforge.net/), for `.tiff`[libtiff](http://www.libtiff.org/), for `.xpm` - libxpm.
139128

129+
`.png` images works out of the box.
130+
140131
### MacOS
141132

142-
> ⛔️ Doesn't work. Waiting for brew approve ⛔️
133+
> ⛔️ Doesn't work. Waiting for brew approve ⛔️
143134
144135
```
145136
brew install odiff
@@ -167,23 +158,23 @@ Performance matters. At least for sort of tasks like visual regression. For exam
167158
3s * 25000 / 3600 = 20,83333 hours
168159
```
169160

170-
Here is `odiff` performance comparison with other popular visual difference solutions. We are going to compare some real-world use cases.
161+
Here is `odiff` performance comparison with other popular visual difference solutions. We are going to compare some real-world use cases.
171162

172163
Lets compare 2 screenshots of full-size [https://cypress.io](cypress.io) page:
173164

174165
| Command | Mean [s] | Min [s] | Max [s] | Relative |
175166
| :----------------------------------------------------------------------------------------- | ------------: | ------: | ------: | ----------: |
176-
| `pixelmatch www.cypress.io-1.png www.cypress.io.png www.cypress-diff.png` | 7.712 ± 0.069 | 7.664 | 7.896 | 1.82 ± 0.03 |
177-
| ImageMagick `compare www.cypress.io-1.png www.cypress.io.png -compose src diff-magick.png` | 8.881 ± 0.121 | 8.692 | 9.066 | 2.09 ± 0.04 |
178-
| `odiff www.cypress.io-1.png www.cypress.io.png www.cypress-diff.png` | 4.247 ± 0.053 | 4.178 | 4.344 | 1.00 |
167+
| `pixelmatch www.cypress.io-1.png www.cypress.io.png www.cypress-diff.png` | 7.712 ± 0.069 | 7.664 | 7.896 | 6.67 ± 0.03 |
168+
| ImageMagick `compare www.cypress.io-1.png www.cypress.io.png -compose src diff-magick.png` | 8.881 ± 0.121 | 8.692 | 9.066 | 7.65 ± 0.04 |
169+
| `odiff www.cypress.io-1.png www.cypress.io.png www.cypress-diff.png` | 1.168 ± 0.008 | 1.157 | 1.185 | 1.00 |
179170

180-
Wow. Odiff is mostly 2 times faster than imagemagick and pixelmatch. And this will be even clearer if image will become larger. Lets compare a [4k image](images/water-4k.png) to find a difference with [another 4k image](images/water-4k-2.png):
171+
Wow. Odiff is mostly 2 times faster than imagemagick and pixelmatch. And this will be even clearer if image will become larger. Lets compare an [8k image](images/water-4k.png) to find a difference with [another 8k image](images/water-4k-2.png):
181172

182173
| Command | Mean [s] | Min [s] | Max [s] | Relative |
183174
| :---------------------------------------------------------------------------- | -------------: | ------: | ------: | ----------: |
184-
| `ODiffBin water-4k.png water-4k-2.png water-diff.png` | 4.873 ± 0.090 | 4.814 | 5.105 | 1.00 |
185-
| `pixelmatch water-4k.png water-4k-2.png water-diff.png` | 10.614 ± 0.162 | 10.398 | 10.910 | 2.18 ± 0.05 |
186-
| Imagemagick `compare water-4k.png water-4k-2.png -compose src water-diff.png` | 9.326 ± 0.436 | 8.819 | 10.394 | 1.91 ± 0.10 |
175+
| `pixelmatch water-4k.png water-4k-2.png water-diff.png` | 10.614 ± 0.162 | 10.398 | 10.910 | 5.50 ± 0.05 |
176+
| Imagemagick `compare water-4k.png water-4k-2.png -compose src water-diff.png` | 9.326 ± 0.436 | 8.819 | 10.394 | 5.24 ± 0.10 |
177+
| `odiff water-4k.png water-4k-2.png water-diff.png` | 1.951 ± 0.014 | 1.936 | 1.981 | 1.00 |
187178

188179
Yes it is significant improvement. And the produced difference will be the same for all 3 commands.
189180

images/benchmarks.png

744 KB
Loading

0 commit comments

Comments
 (0)