ssim.js 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CLA.md +66 -0
  2. package/CONTRIBUTING.md +119 -0
  3. package/LICENSE +1 -1
  4. package/LICENSES/LIVE Images Database +18 -0
  5. package/LICENSES/Subjective quality assessment - IVC database +5 -0
  6. package/LICENSES/Wang et al SSIM +24 -0
  7. package/LICENSES/bezkrovny +49 -0
  8. package/LICENSES/cell2csv +2 -0
  9. package/LICENSES/obartra-ssim +21 -0
  10. package/LICENSES/rhys-e +21 -0
  11. package/README.md +216 -34
  12. package/dist/bezkrovnySsim.d.ts +5 -19
  13. package/dist/bezkrovnySsim.js +113 -72
  14. package/dist/bezkrovnySsim.js.map +1 -1
  15. package/dist/browser.d.mts +9 -0
  16. package/dist/browser.d.ts +9 -0
  17. package/dist/browser.js +37 -0
  18. package/dist/browser.js.map +1 -0
  19. package/dist/browser.mjs +742 -0
  20. package/dist/browser.mjs.map +7 -0
  21. package/dist/defaults.d.ts +3 -1
  22. package/dist/defaults.js +14 -4
  23. package/dist/defaults.js.map +1 -1
  24. package/dist/gaussian.d.ts +2 -0
  25. package/dist/gaussian.js +168 -0
  26. package/dist/gaussian.js.map +1 -0
  27. package/dist/gaussianSymmetric.d.ts +3 -0
  28. package/dist/gaussianSymmetric.js +62 -0
  29. package/dist/gaussianSymmetric.js.map +1 -0
  30. package/dist/index.d.mts +9 -0
  31. package/dist/index.d.ts +8 -19
  32. package/dist/index.js +19 -88
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.mjs +718 -0
  35. package/dist/index.mjs.map +7 -0
  36. package/dist/options.d.ts +2 -0
  37. package/dist/options.js +60 -0
  38. package/dist/options.js.map +1 -0
  39. package/dist/originalSsim.d.ts +3 -26
  40. package/dist/originalSsim.js +5 -57
  41. package/dist/originalSsim.js.map +1 -1
  42. package/dist/pixels.d.ts +5 -0
  43. package/dist/pixels.js +157 -0
  44. package/dist/pixels.js.map +1 -0
  45. package/dist/prepare.d.ts +7 -0
  46. package/dist/prepare.js +48 -0
  47. package/dist/prepare.js.map +1 -0
  48. package/dist/referenceSsim.d.ts +4 -0
  49. package/dist/referenceSsim.js +59 -0
  50. package/dist/referenceSsim.js.map +1 -0
  51. package/dist/result.d.ts +2 -0
  52. package/dist/result.js +20 -0
  53. package/dist/result.js.map +1 -0
  54. package/dist/ssim.d.ts +3 -21
  55. package/dist/ssim.js +4 -126
  56. package/dist/ssim.js.map +1 -1
  57. package/dist/ssim.web.js +2 -2
  58. package/dist/ssim.web.js.map +7 -1
  59. package/dist/types.d.ts +27 -7
  60. package/dist/weberSsim.d.ts +19 -0
  61. package/dist/weberSsim.js +119 -0
  62. package/dist/weberSsim.js.map +1 -0
  63. package/package.json +116 -1
  64. package/src/bezkrovnySsim.ts +133 -67
  65. package/src/browser.ts +49 -0
  66. package/src/defaults.ts +16 -6
  67. package/src/gaussian.ts +228 -0
  68. package/src/gaussianSymmetric.ts +95 -0
  69. package/src/index.ts +47 -96
  70. package/src/options.ts +74 -0
  71. package/src/originalSsim.ts +9 -79
  72. package/src/pixels.ts +198 -0
  73. package/src/prepare.ts +73 -0
  74. package/src/referenceSsim.ts +71 -0
  75. package/src/result.ts +23 -0
  76. package/src/ssim.ts +9 -168
  77. package/src/types.ts +44 -15
  78. package/src/weberSsim.ts +132 -0
  79. package/dist/downsample.d.ts +0 -12
  80. package/dist/downsample.js +0 -70
  81. package/dist/downsample.js.map +0 -1
  82. package/dist/math.d.ts +0 -155
  83. package/dist/math.js +0 -394
  84. package/dist/math.js.map +0 -1
  85. package/dist/matlab/conv2.d.ts +0 -137
  86. package/dist/matlab/conv2.js +0 -250
  87. package/dist/matlab/conv2.js.map +0 -1
  88. package/dist/matlab/filter2.d.ts +0 -18
  89. package/dist/matlab/filter2.js +0 -53
  90. package/dist/matlab/filter2.js.map +0 -1
  91. package/dist/matlab/fspecial.d.ts +0 -39
  92. package/dist/matlab/fspecial.js +0 -102
  93. package/dist/matlab/fspecial.js.map +0 -1
  94. package/dist/matlab/imfilter.d.ts +0 -24
  95. package/dist/matlab/imfilter.js +0 -84
  96. package/dist/matlab/imfilter.js.map +0 -1
  97. package/dist/matlab/index.d.ts +0 -23
  98. package/dist/matlab/index.js +0 -29
  99. package/dist/matlab/index.js.map +0 -1
  100. package/dist/matlab/internal/numbers.d.ts +0 -14
  101. package/dist/matlab/internal/numbers.js +0 -28
  102. package/dist/matlab/internal/numbers.js.map +0 -1
  103. package/dist/matlab/mod.d.ts +0 -21
  104. package/dist/matlab/mod.js +0 -27
  105. package/dist/matlab/mod.js.map +0 -1
  106. package/dist/matlab/normpdf.d.ts +0 -36
  107. package/dist/matlab/normpdf.js +0 -55
  108. package/dist/matlab/normpdf.js.map +0 -1
  109. package/dist/matlab/ones.d.ts +0 -15
  110. package/dist/matlab/ones.js +0 -22
  111. package/dist/matlab/ones.js.map +0 -1
  112. package/dist/matlab/padarray.d.ts +0 -37
  113. package/dist/matlab/padarray.js +0 -349
  114. package/dist/matlab/padarray.js.map +0 -1
  115. package/dist/matlab/rgb2gray.d.ts +0 -15
  116. package/dist/matlab/rgb2gray.js +0 -58
  117. package/dist/matlab/rgb2gray.js.map +0 -1
  118. package/dist/matlab/skip2d.d.ts +0 -34
  119. package/dist/matlab/skip2d.js +0 -55
  120. package/dist/matlab/skip2d.js.map +0 -1
  121. package/dist/matlab/sub.d.ts +0 -17
  122. package/dist/matlab/sub.js +0 -33
  123. package/dist/matlab/sub.js.map +0 -1
  124. package/dist/matlab/transpose.d.ts +0 -18
  125. package/dist/matlab/transpose.js +0 -34
  126. package/dist/matlab/transpose.js.map +0 -1
  127. package/dist/matlab/zeros.d.ts +0 -15
  128. package/dist/matlab/zeros.js +0 -22
  129. package/dist/matlab/zeros.js.map +0 -1
  130. package/dist/version.d.ts +0 -2
  131. package/dist/version.js +0 -5
  132. package/dist/version.js.map +0 -1
  133. package/src/downsample.ts +0 -81
  134. package/src/math.ts +0 -447
  135. package/src/matlab/conv2.ts +0 -272
  136. package/src/matlab/filter2.ts +0 -52
  137. package/src/matlab/fspecial.ts +0 -107
  138. package/src/matlab/imfilter.ts +0 -93
  139. package/src/matlab/index.ts +0 -23
  140. package/src/matlab/internal/numbers.ts +0 -28
  141. package/src/matlab/mod.ts +0 -23
  142. package/src/matlab/normpdf.ts +0 -57
  143. package/src/matlab/ones.ts +0 -19
  144. package/src/matlab/padarray.ts +0 -375
  145. package/src/matlab/rgb2gray.ts +0 -65
  146. package/src/matlab/skip2d.ts +0 -58
  147. package/src/matlab/sub.ts +0 -38
  148. package/src/matlab/transpose.ts +0 -33
  149. package/src/matlab/zeros.ts +0 -19
  150. package/src/types/bmp-js.d.ts +0 -1
  151. package/src/version.ts +0 -2
package/CLA.md ADDED
@@ -0,0 +1,66 @@
1
+ ### SSIM Individual Contributor License Agreement
2
+
3
+ Thank you for your interest in contributing to open source software projects (“Projects”) made available by ssim.js or its affiliates. This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to ssim.js in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact obartra@gmail.com
4
+
5
+
6
+ You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
7
+
8
+
9
+ **Copyright License.** You hereby grant, and agree to grant, to ssim.js a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute your Contributions and such derivative works, with the right to sublicense the foregoing rights through multiple tiers of sublicensees.
10
+
11
+
12
+ **Patent License.** You hereby grant, and agree to grant, to ssim.js a non-exclusive, perpetual, irrevocable,
13
+ worldwide, fully-paid, royalty-free, transferable patent license to make, have made, use, offer to sell, sell,
14
+ import, and otherwise transfer your Contributions, where such license applies only to those patent claims
15
+ licensable by you that are necessarily infringed by your Contributions alone or by combination of your
16
+ Contributions with the Project to which such Contributions were submitted, with the right to sublicense the
17
+ foregoing rights through multiple tiers of sublicensees.
18
+
19
+
20
+ **Moral Rights.** To the fullest extent permitted under applicable law, you hereby waive, and agree not to
21
+ assert, all of your “moral rights” in or relating to your Contributions for the benefit of ssim.js, its assigns, and
22
+ their respective direct and indirect sublicensees.
23
+
24
+
25
+ **Third Party Content/Rights.** If your Contribution includes or is based on any source code, object code, bug
26
+ fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or
27
+ other works of authorship that were not authored by you (“Third Party Content”) or if you are aware of any
28
+ third party intellectual property or proprietary rights associated with your Contribution (“Third Party Rights”),
29
+ then you agree to include with the submission of your Contribution full details respecting such Third Party
30
+ Content and Third Party Rights, including, without limitation, identification of which aspects of your
31
+ Contribution contain Third Party Content or are associated with Third Party Rights, the owner/author of the
32
+ Third Party Content and Third Party Rights, where you obtained the Third Party Content, and any applicable
33
+ third party license terms or restrictions respecting the Third Party Content and Third Party Rights. For greater
34
+ certainty, the foregoing obligations respecting the identification of Third Party Content and Third Party Rights
35
+ do not apply to any portion of a Project that is incorporated into your Contribution to that same Project.
36
+
37
+
38
+ **Representations.** You represent that, other than the Third Party Content and Third Party Rights identified by
39
+ you in accordance with this Agreement, you are the sole author of your Contributions and are legally entitled
40
+ to grant the foregoing licenses and waivers in respect of your Contributions. If your Contributions were
41
+ created in the course of your employment with your past or present employer(s), you represent that such
42
+ employer(s) has authorized you to make your Contributions on behalf of such employer(s) or such employer
43
+ (s) has waived all of their right, title or interest in or to your Contributions.
44
+
45
+
46
+ **Disclaimer.** To the fullest extent permitted under applicable law, your Contributions are provided on an "asis"
47
+ basis, without any warranties or conditions, express or implied, including, without limitation, any implied
48
+ warranties or conditions of non-infringement, merchantability or fitness for a particular purpose. You are not
49
+ required to provide support for your Contributions, except to the extent you desire to provide support.
50
+
51
+
52
+ **No Obligation.** You acknowledge that ssim.js is under no obligation to use or incorporate your Contributions
53
+ into any of the Projects. The decision to use or incorporate your Contributions into any of the Projects will be
54
+ made at the sole discretion of ssim.js or its authorized delegates.
55
+
56
+
57
+ **Disputes.** This Agreement shall be governed by and construed in accordance with the laws of the State of
58
+ New York, United States of America, without giving effect to its principles or rules regarding conflicts of laws,
59
+ other than such principles directing application of New York law. The parties hereby submit to venue in, and
60
+ jurisdiction of the courts located in New York, New York for purposes relating to this Agreement. In the event
61
+ that any of the provisions of this Agreement shall be held by a court or other tribunal of competent jurisdiction
62
+ to be unenforceable, the remaining portions hereof shall remain in full force and effect.
63
+
64
+
65
+ **Assignment.** You agree that ssim.js may assign this Agreement, and all of its rights, obligations and licenses
66
+ hereunder.
@@ -0,0 +1,119 @@
1
+ # Contributing
2
+
3
+ External contributors must sign the [existing individual CLA](CLA.md) when CLA
4
+ Assistant requests it. Follow the bot’s signing link on your PR. Existing signatures
5
+ remain with the hosted integration; a sign-off or checkbox is not a CLA signature.
6
+ Identify third-party code and license terms, and confirm any employer authorization
7
+ required by the agreement. See [Contributor setup](docs/Contributors.md) for the
8
+ automated check and one-time owner activation. This setup is currently local only.
9
+
10
+ Use maintained Node.js LTS (22.14+), with npm and the committed package-lock.json.
11
+ The published library has no runtime dependencies. The native `canvas` decoder is
12
+ a development dependency retained to preserve historical image-fixture decoding.
13
+ Platforms without a prebuilt binary need its native build dependencies.
14
+
15
+ ```sh
16
+ npm ci
17
+ npm run lint
18
+ npm run build
19
+ npm run typecheck
20
+ npm test
21
+ npm run test:coverage
22
+ npm run test:package
23
+ npx playwright install --with-deps chromium firefox webkit
24
+ npm run test:browser
25
+ ```
26
+
27
+ Build before testing: historical IVC comparisons load `dist`. The TypeScript suite runs directly in Node with native type stripping and
28
+ `node:test`/`node:assert`. Scientific reference values are ordinary assertions and
29
+ JSON fixtures; there is no snapshot-generation step or Jest transformer.
30
+ Native V8 coverage checks the built, unbundled JavaScript implementation; browser
31
+ bundles have separate Playwright checks. Coverage metrics differ from Istanbul
32
+ and are documented in the modernization guide. Do not regenerate references to
33
+ hide numerical drift. Use `npm run format` for source and documentation formatting.
34
+
35
+ ESLint flat configuration checks source TypeScript, tests, build scripts, and
36
+ configuration. Historical test fixtures allow explicit `any`; production source
37
+ does not. Archived scientific generation scripts in `generate/` are excluded from
38
+ linting and remain historical tooling, not a supported application CLI.
39
+
40
+ For comparison timings, build and run `npm run benchmark`. It records medians on
41
+ decoded fixtures against 3.5.0; timing differences are not correctness assertions.
42
+ See [Performance](docs/Performance.md) for the accumulator memory tradeoff.
43
+
44
+ The package check installs a real tarball into a temporary offline consumer. It
45
+ checks CJS/ESM loading, default/named imports, declarations with NodeNext resolution,
46
+ and numerical equivalence within 1e-12 against the pinned development-only npm
47
+ 3.5.0 baseline.
48
+ Playwright checks ESM and script builds in Chromium, Firefox, and WebKit with
49
+ cross-engine tolerances of 1e-12 for scores and map values. WebKit is a Safari-engine
50
+ proxy. The separate `npm run test:safari` uses Apple’s actual browser on macOS;
51
+ see [Validation](docs/Validation.md) for local vendor-build evidence and setup.
52
+
53
+ CI checks Node 22/24/26 and the three browser engines, with prepared Windows/macOS
54
+ package jobs and an actual Safari WebDriver job. It has read-only repository
55
+ permissions and never publishes. See [Migration](docs/Migration.md) for supported
56
+ runtimes, and [Modernization](docs/Modernization.md) for architecture and release status.
57
+ The excluded WASM/Go experiments are documented in [Performance](docs/Performance.md).
58
+
59
+ Use conventional commits if useful to reviewers; there is no required commit CLI.
60
+ Update repository guides and wiki together. Publishing is a deliberate release:
61
+ review a version bump, run the full checks, inspect `npm pack --dry-run`, and configure
62
+ npm trusted publishing/provenance in a protected release job before publishing.
63
+ The release manifest is 5.0.0. Publication uses the manually dispatched release workflow.
64
+
65
+ Test files and helpers live under `spec/package.json` with `type: module`. Runtime
66
+ imports use explicit extensions; type-only imports use `import type`. Tests import
67
+ the built library so that the same JavaScript consumers receive is under test.
68
+ `tsc --noEmit` separately checks tests with `erasableSyntaxOnly` and `verbatimModuleSyntax`.
69
+ The strip-types flag is explicit for early supported Node 22 releases. The native
70
+ runner executes the module suite serially without process isolation, like the former
71
+ in-band Jest setup. There is no custom Jest compatibility layer or loader.
72
+
73
+ For comparisons with other libraries, run `npm ci --prefix benchmarks/competitors`,
74
+ then `npm run benchmark:compare -- --output docs/benchmarks/comparison-node24.json`
75
+ and `npm run benchmark:report`. Regenerate the SVG with Python/matplotlib using
76
+ `scripts/plot-comparison.py`. Commit raw results, exact versions/settings, and the
77
+ chart together. The comparison tools are isolated and never shipped. Distinguish
78
+ sampling, metric, output, precision, and native/JS execution when describing wins;
79
+ do not turn one machine's results into a universal fastest-library claim.
80
+
81
+ For numerical/optimization changes, also run:
82
+
83
+ ```sh
84
+ npm run validate:corpus -- --output /tmp/corpus.json
85
+ # All indexed LIVE images as well as IVC/Lena/aspect ratio:
86
+ npm run validate:corpus -- --all-live --output /tmp/full-corpus.json
87
+ ```
88
+
89
+ CI includes the stratified corpus gate; release validation uses the full index.
90
+ Preserve weights, sampling, downsampling, grayscale rounding, and documented error
91
+ bounds. Compare full maps, not just a pooled score. Distinct approximation modes
92
+ are not interchangeable equivalence proofs. Performance reports must identify
93
+ returned outputs and use the fingerprinted harness; do not turn host-specific
94
+ timings into correctness thresholds. See [Algorithms](docs/Algorithms.md),
95
+ [Comparison](docs/Comparison.md), and [Setup access](docs/Setup-access.md).
96
+
97
+ ## Documentation and the local wiki
98
+
99
+ Edit canonical guides under `docs/`; Home, Sidebar and Footer sources live under
100
+ `docs/wiki/`. The prepared wiki is generated from those sources rather than edited
101
+ independently:
102
+
103
+ ```sh
104
+ npm run docs:check
105
+ npm run wiki:sync -- --wiki-dir ../ssim-wiki
106
+ npm run wiki:check -- --wiki-dir ../ssim-wiki
107
+ ```
108
+
109
+ These commands only read/write local files; they never fetch, push or update GitHub.
110
+ Unmanaged local wiki pages are preserved and reported. The read-only check rejects
111
+ missing/stale pages, broken local targets/anchors/assets and changed historical
112
+ archive bodies. Wiki synchronization requires a destination outside the source
113
+ checkout. Prepared CI runs the source/workflow checks without needing a wiki clone.
114
+
115
+ The browser suite executes the literal marked module/worker snippets in
116
+ `docs/Node-and-Browsers.md`; keep those examples runnable. Historical wiki bodies
117
+ are formatter-excluded provenance: correct the current guides or archive notice,
118
+ not the preserved old text. [Wiki review](docs/Wiki-review.md) records the audited
119
+ scope and the distinction between local checks and live external availability.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017 Oscar
3
+ Copyright (c) 2017-2020 Oscar Bartra Carreras <obartra@gmail.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,18 @@
1
+ -----------COPYRIGHT NOTICE STARTS WITH THIS LINE------------
2
+ Copyright (c) 2005 The University of Texas at Austin
3
+ All rights reserved.
4
+
5
+ Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this database (the images, the results and the source files) and its documentation for any purpose, provided that the copyright notice in its entirety appear in all copies of this database, and the original source of this database, Laboratory for Image and Video Engineering (LIVE, http://live.ece.utexas.edu ) and Center for Perceptual Systems (CPS, http://www.cps.utexas.edu ) at the University of Texas at Austin (UT Austin, http://www.utexas.edu ), is acknowledged in any publication that reports research using this database.
6
+
7
+ The database and our papers are to be cited in the bibliography as:
8
+
9
+ H. R. Sheikh, Z. Wang, L. Cormack and A. C. Bovik, "LIVE Image Quality Assessment Database Release 2", http://live.ece.utexas.edu/research/quality .
10
+ H. R. Sheikh, M.F. Sabir and A.C. Bovik, "A statistical evaluation of recent full reference image quality assessment algorithms", IEEE Transactions on Image Processing, vol. 15, no. 11, pp. 3440-3451, Nov. 2006.
11
+ Z. Wang, A.C. Bovik, H.R. Sheikh and E.P. Simoncelli, "Image quality assessment: from error visibility to structural similarity," IEEE Transactions on Image Processing , vol.13, no.4, pp. 600- 612, April 2004.
12
+ IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT AUSTIN BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS DATABASE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF TEXAS AT AUSTIN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13
+
14
+ THE UNIVERSITY OF TEXAS AT AUSTIN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE DATABASE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF TEXAS AT AUSTIN HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
15
+
16
+ The following input images are from the CD "Austin and Vicinity" by Visual Delights Inc.
17
+ ( http://www.visualdelights.net ) coinsinfountain.bmp, dancers.bmp, flowersonih35.bmp, studentsculpture.bmp, carnivaldolls.bmp, cemetry.bmp, manfishing.bmp, churchandcapitol.bmp, building2.bmp These images were modified from the original (resized) and then compressed to obtain images in the database. Permission to release these images and their distorted versions was graciously granted by Visual Delights Inc. These images may not be used outside the scope of this database without their prior permission. The rest of the images were public domain Kodak PhotoCD images obtained from the Internet.
18
+ -----------COPYRIGHT NOTICE ENDS WITH THIS LINE------------
@@ -0,0 +1,5 @@
1
+ This database was used in
2
+
3
+ Alexandre Ninassi, Patrick Le Callet, Florent Autrusseau, "Pseudo No Reference image quality metric using perceptual data hiding", in SPIE Human Vision and Electronic Imaging, vol. 6057-08, San Jose, CA, USA, January 2006.
4
+
5
+ Obtained from: http://www2.irccyn.ec-nantes.fr/ivcdb/
@@ -0,0 +1,24 @@
1
+ Reference images used to validate SSIM computations extracted from http://www.cns.nyu.edu/~lcv/ssim.
2
+
3
+ Article and matlab scripts included at the `/assets` folder are also copies from the ones obtainable at their website.
4
+
5
+ The following is their copyright notice:
6
+
7
+ -----------COPYRIGHT NOTICE STARTS WITH THIS LINE------------
8
+ Copyright (c) 2005 The University of Texas at Austin
9
+ All rights reserved.
10
+
11
+ Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this database (the images, the results and the source files) and its documentation for any purpose, provided that the copyright notice in its entirety appear in all copies of this database, and the original source of this database, Laboratory for Image and Video Engineering (LIVE, http://live.ece.utexas.edu ) and Center for Perceptual Systems (CPS, http://www.cps.utexas.edu ) at the University of Texas at Austin (UT Austin, http://www.utexas.edu ), is acknowledged in any publication that reports research using this database.
12
+
13
+ The database and our papers are to be cited in the bibliography as:
14
+
15
+ H. R. Sheikh, Z. Wang, L. Cormack and A. C. Bovik, "LIVE Image Quality Assessment Database Release 2", http://live.ece.utexas.edu/research/quality .
16
+ H. R. Sheikh, M.F. Sabir and A.C. Bovik, "A statistical evaluation of recent full reference image quality assessment algorithms", IEEE Transactions on Image Processing, vol. 15, no. 11, pp. 3440-3451, Nov. 2006.
17
+ Z. Wang, A.C. Bovik, H.R. Sheikh and E.P. Simoncelli, "Image quality assessment: from error visibility to structural similarity," IEEE Transactions on Image Processing , vol.13, no.4, pp. 600- 612, April 2004.
18
+ IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT AUSTIN BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS DATABASE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF TEXAS AT AUSTIN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+
20
+ THE UNIVERSITY OF TEXAS AT AUSTIN SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE DATABASE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF TEXAS AT AUSTIN HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
21
+
22
+ The following input images are from the CD "Austin and Vicinity" by Visual Delights Inc.
23
+ ( http://www.visualdelights.net ) coinsinfountain.bmp, dancers.bmp, flowersonih35.bmp, studentsculpture.bmp, carnivaldolls.bmp, cemetry.bmp, manfishing.bmp, churchandcapitol.bmp, building2.bmp These images were modified from the original (resized) and then compressed to obtain images in the database. Permission to release these images and their distorted versions was graciously granted by Visual Delights Inc. These images may not be used outside the scope of this database without their prior permission. The rest of the images were public domain Kodak PhotoCD images obtained from the Internet.
24
+ -----------COPYRIGHT NOTICE ENDS WITH THIS LINE------------
@@ -0,0 +1,49 @@
1
+ # image-quantization (https://github.com/igor-bezkrovny/image-quantization)
2
+
3
+ The MIT License (MIT)
4
+
5
+ Copyright (c) 2015 Igor Bezkrovny
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+
25
+ # http://members.ozemail.com.au/~dekker/NEUQUANT.HTML
26
+
27
+ NeuQuant Neural-Net Quantization Algorithm
28
+ ------------------------------------------
29
+
30
+ Copyright (c) 1994 Anthony Dekker
31
+
32
+ NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994. See
33
+ "Kohonen neural networks for optimal colour quantization" in "Network:
34
+ Computation in Neural Systems" Vol. 5 (1994) pp 351-367. for a discussion of
35
+ the algorithm.
36
+
37
+ Any party obtaining a copy of these files from the author, directly or
38
+ indirectly, is granted, free of charge, a full and unrestricted irrevocable,
39
+ world-wide, paid up, royalty-free, nonexclusive right and license to deal in
40
+ this software and documentation files (the "Software"), including without
41
+ limitation the rights to use, copy, modify, merge, publish, distribute,
42
+ sublicense, and/or sell copies of the Software, and to permit persons who
43
+ receive copies from any such party to do so, with the only requirement being
44
+ that this copyright notice remain intact.
45
+
46
+ # https://github.com/leeoniya/RgbQuant.js
47
+
48
+ Copyright (c) 2015, Leon Sorokin
49
+ All rights reserved. (MIT Licensed)
@@ -0,0 +1,2 @@
1
+ The matlab script to convert a cell matrix into a csv file used was created by Sylvain Fiedler, KA, 2004
2
+ and updated by S.Fiedler
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Oscar Bartra Carreras
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 rhys-e
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,61 +1,243 @@
1
- [![CircleCI](https://circleci.com/gh/obartra/ssim/tree/master.svg?style=shield)](https://circleci.com/gh/obartra/ssim/tree/master) [![Test Coverage](https://codeclimate.com/github/obartra/ssim/badges/coverage.svg)](https://codeclimate.com/github/obartra/ssim/coverage) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT)
1
+ # SSIM.js
2
2
 
3
- # SSIM.JS
3
+ **Reference-faithful image comparison for JavaScript.**
4
4
 
5
- > Get a `0` to `1` score on how similar two images are
5
+ Measure structural changes from compression or image processing, inspect local
6
+ screenshot differences, and verify aligned image candidates. Get a similarity
7
+ score with one call and request a local map when needed, in Node.js or the browser.
6
8
 
7
- The closer [SSIM](https://en.wikipedia.org/wiki/Structural_similarity) is to `1` the higher the similarity. It correlates better with subjective ratings than other measures like [PSNR](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio) and [MSE](https://en.wikipedia.org/wiki/Mean_squared_error). For instance:
9
+ - **Reference faithful by default:** Gaussian SSIM with MATLAB-compatible luminance and scale alignment.
10
+ - **Zero runtime dependencies.** No native binary or WASM startup.
11
+ - **Float64 calculations**, TypeScript declarations, ESM and CommonJS.
8
12
 
9
- | | | |
10
- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
11
- | ![](https://raw.githubusercontent.com/obartra/ssim/master/spec/samples/einstein/Q1.gif) | ![](https://raw.githubusercontent.com/obartra/ssim/master/spec/samples/einstein/Q0988.gif) | ![](https://raw.githubusercontent.com/obartra/ssim/master/spec/samples/einstein/Q0913.gif) |
12
- | Original, MSE = 0, SSIM = 1 | MSE = 144, SSIM = 0.988 | MSE = 144, SSIM = 0.913 |
13
- | ![](https://raw.githubusercontent.com/obartra/ssim/master/spec/samples/einstein/Q0840.gif) | ![](https://raw.githubusercontent.com/obartra/ssim/master/spec/samples/einstein/Q0694.gif) | ![](https://raw.githubusercontent.com/obartra/ssim/master/spec/samples/einstein/Q0662.gif) |
14
- | MSE = 144, SSIM = 0.840 | MSE = 144, SSIM = 0.694 | MSE = 142, SSIM = 0.662 |
13
+ <!-- BUNDLE_SIZE:START -->
15
14
 
16
- _Table extracted from http://www.cns.nyu.edu/~lcv/ssim/_
15
+ **4.91 KiB gzip** / 11.70 KiB minified for the complete core ESM, with **zero runtime dependencies**.
16
+ [Reproduce the measurement](docs/bundle-size.json).
17
17
 
18
- ## 🖥 Install
18
+ <!-- BUNDLE_SIZE:END -->
19
19
 
20
- ```shell
20
+ [Quick start](#quick-start) · [Image files](#compare-image-files) · [Browser loading](#load-images-in-a-browser) · [Applications](#applications) · [Interactive demo](demo/README.md) · [Performance](#performance) · [API](docs/Usage.md)
21
+
22
+ Upgrading from v3 or the historical v4 releases? Read the [migration guide](docs/Migration.md): the default
23
+ algorithm changes to Gaussian SSIM and local maps require `{ map: true }`.
24
+
25
+ ## Quick start
26
+
27
+ ```sh
21
28
  npm install ssim.js
22
29
  ```
23
30
 
24
- You can also use the web version directly from [unpkg](https://unpkg.com)'s CDN: `https://unpkg.com/ssim.js@{{version}}/dist/ssim.web.js`.
31
+ ```js
32
+ import { ssim } from 'ssim.js'
33
+
34
+ const image = {
35
+ width: 16,
36
+ height: 16,
37
+ data: new Uint8ClampedArray(16 * 16 * 4).fill(255),
38
+ }
25
39
 
26
- ## 📝 Usage
40
+ const { mssim } = ssim(image, image)
41
+ console.log(mssim) // 1
42
+ ```
27
43
 
28
- Check out the [playground](https://ssim-comparison.gomix.me/) for node and web usage examples.
44
+ CommonJS: `const { ssim } = require('ssim.js')`. Requires Node 22.14+ or an evergreen browser.
45
+ Pass matching decoded RGBA objects: `{ width, height, data }`, with exactly
46
+ `width * height * 4` bytes in a `Uint8Array`, `Uint8ClampedArray` or Node `Buffer`.
47
+ Browser `ImageData` works directly. Alpha is ignored; composite onto the same
48
+ background first when rendered transparency matters.
49
+
50
+ ## Compare image files
51
+
52
+ Install an image decoder separately: `npm install sharp`. The library itself has no dependencies.
53
+
54
+ ```js
55
+ import sharp from 'sharp'
56
+ import { ssim } from 'ssim.js'
57
+
58
+ async function readPixels(file) {
59
+ const { data, info } = await sharp(file)
60
+ .rotate()
61
+ .toColourspace('srgb')
62
+ .ensureAlpha()
63
+ .raw()
64
+ .toBuffer({ resolveWithObject: true })
65
+ return { width: info.width, height: info.height, data }
66
+ }
67
+
68
+ const files = process.argv.slice(2)
69
+ if (files.length !== 2)
70
+ throw new Error('Usage: node compare.mjs before.png after.png')
71
+ const [before, after] = await Promise.all(files.map(readPixels))
72
+ console.log(ssim(before, after).mssim)
73
+ ```
29
74
 
30
- SSIM.js takes in 2 image buffers and optional options parameter. You can find all options available [here](https://github.com/obartra/ssim/wiki/Usage#options).
75
+ Save as `compare.mjs` and run `node compare.mjs before.png after.png`.
76
+ The loader normalizes orientation and preserves dimensions; it does not align or resize images.
31
77
 
32
- For examples on how to implement image loading strategies for both node and the web, check out [this wiki page](https://github.com/obartra/ssim/wiki/Node-and-Browsers).
78
+ ## Load images in a browser
33
79
 
34
80
  ```js
35
- import ssim from "ssim.js";
81
+ import { compareImages, loadImage } from 'ssim.js/browser'
82
+ import { ssim } from 'ssim.js'
83
+
84
+ // URLs, File/Blob objects and HTMLImageElements are accepted.
85
+ const result = await compareImages('/before.png', '/after.png')
86
+ console.log(result.mssim)
87
+
88
+ // Decode once when comparing repeatedly or measuring performance.
89
+ const [before, after] = await Promise.all([
90
+ loadImage('/before.png'),
91
+ loadImage('/after.png'),
92
+ ])
93
+ console.log(ssim(before, after).mssim)
94
+ ```
95
+
96
+ The optional browser entry has no dependencies and keeps DOM/image-loading code
97
+ out of the core entry. Decoding is asynchronous and excluded from the result’s
98
+ comparison time. Cross-origin images need CORS; image dimensions must match.
99
+ For large comparisons, use a [worker](docs/Node-and-Browsers.md#browser-worker).
100
+ Without a bundler, serve `dist/browser.mjs` or `dist/index.mjs` directly.
101
+
102
+ ## Understand the result
36
103
 
37
- const img1 = loadImage("./img1.jpg");
38
- const img2 = loadImage("./img2.jpg");
104
+ | Field | Meaning |
105
+ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
106
+ | `mssim` | Mean SSIM. Higher means more similar under the chosen settings; negative scores are possible. |
107
+ | `ssim_map` | `{ width, height, data }`, with local scores in row-major order; present only with `map: true`. |
108
+ | `performance` | Comparison milliseconds, including preparation and excluding decoding. Use `performance.now()` around warmed calls for benchmarks. |
39
109
 
40
- const { mssim, performance } = ssim(img1, img2);
110
+ SSIM is not a percentage, exact-pixel equality check, or universal pass/fail threshold.
111
+ A high mean can hide a small edit. Inspect the map or use a pixel-diff tool when
112
+ individual pixels matter. `mssim` means mean SSIM, not the separate MS-SSIM algorithm.
41
113
 
42
- console.log(`SSIM: ${mssim} (${performance}ms)`);
114
+ To inspect local differences, request a map explicitly:
115
+
116
+ ```js
117
+ const { mssim, ssim_map } = ssim(before, after, { map: true })
118
+ console.log(mssim, ssim_map.width, ssim_map.height)
43
119
  ```
44
120
 
45
- ## 📖 Documentation
121
+ The default returns the score without allocating a full local map. It still
122
+ computes every required window with the same Gaussian weights and precision.
123
+
124
+ ## Applications
125
+
126
+ | Task | How SSIM helps | What else matters |
127
+ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
128
+ | Compression and image-processing checks | Measure structural change against the original; select the smallest encoded file meeting your quality target | Calibrate targets for your content; a score is not a human acceptance guarantee |
129
+ | Screenshot diagnostics | Inspect a full-resolution map and its worst regions to find small structural defects | Add color/pixel checks when exact colors matter; calibrate nuisance tolerance |
130
+ | Aligned near-duplicate verification | Compare a retrieved candidate with a reference after resizing/alignment | Retrieval, crops, rotations and semantic matching need additional methods |
131
+
132
+ Our [measured application study](docs/Applications.md) includes 704 pairs,
133
+ separate calibration/evaluation images, competing screenshot tools and explicit
134
+ failure cases. Regional diagnostics retain the SSIM map but use different pooling;
135
+ they are separate from the author-reference mean returned by default.
136
+
137
+ ## Accuracy
138
+
139
+ The default is the authors’ Gaussian profile: 11×11 windows, sigma 1.5, population
140
+ moments, MATLAB luminance and correctly aligned scale selection. Independent
141
+ centered-moment, negative-score and degenerate-patch tests complement the published
142
+ LIVE/IVC results. Scientific golden values are preserved.
143
+
144
+ <!-- REFERENCE_SUMMARY:START -->
145
+
146
+ The author Gaussian profile matches all **1,167 published LIVE/IVC scores** with
147
+ maximum mean-score error **8.17e-14**, and reproduces the authors' human-rating
148
+ rank correlations. See the study for configurations and limits.
149
+
150
+ <!-- REFERENCE_SUMMARY:END -->
151
+
152
+ [Reference fidelity](docs/Reference-fidelity.md) records exact errors, input/source
153
+ hashes, human-rating correlations and comparator settings. Matching reference
154
+ SSIM does not imply the best possible predictor of human preference on every dataset.
155
+
156
+ ## Performance
157
+
158
+ <!-- AUTHOR_PERFORMANCE:START -->
159
+
160
+ JavaScript Gaussian SSIM, including normal preparation and score calculation:
161
+
162
+ | Implementation | 256×256 noise | 1024×768 local edit | 1920×1080 local edit |
163
+ | --- | ---: | ---: | ---: |
164
+ | SSIM.js default · score only | 4.34 ms | 11.89 ms | 24.76 ms |
165
+ | BlazeDiff JS · score only | 10.01 ms | 44.41 ms | 122.68 ms |
166
+
167
+ The current default is **2.14–4.96× faster** than the measured BlazeDiff JS Gaussian path across all seven fixtures.
168
+ See the recorded configurations and workload limits below.
169
+
170
+ <!-- AUTHOR_PERFORMANCE:END -->
171
+
172
+ ![JavaScript Gaussian SSIM timings](docs/assets/comparison-js.svg)
173
+
174
+ These are our own three-round measurements on seven fixtures, using warm,
175
+ repeated decoded-RGBA calls. Both rows return scores without maps; ordinary
176
+ preparation and allocations are timed. Imports, decoding and initialization are
177
+ excluded. Preprocessing and numerical choices differ, so these are complete API
178
+ measurements rather than assertions of identical scores.
179
+
180
+ The default Gaussian path uses separable filtering and symmetric taps with Float64
181
+ moments. Every Gaussian tap is retained; the local map is opt-in.
182
+
183
+ <!-- COMPARISON:START -->
184
+
185
+ The broader JavaScript comparison separates three metric families:
186
+
187
+ | Family | JavaScript implementations measured | Output / work |
188
+ | --- | --- | --- |
189
+ | Gaussian SSIM | SSIM.js, BlazeDiff JS | Dense weighted windows; default score-only calls above |
190
+ | Uniform / block SSIM | SSIM.js Weber/Bezkrovny, ssim-grey, 4bitlabs, image-ssim, BlazeDiff JS box variants | Dense or non-overlapping windows; maps and pooling differ |
191
+ | Pixel differences | pixelmatch, BlazeDiff core | Thresholded color-difference counts and anti-alias handling |
192
+
193
+ Fewer windows or a pixel count changes the comparison contract. Compare timings within the required task, and evaluate detection quality separately.
194
+
195
+ <!-- COMPARISON:END -->
196
+
197
+ [Full JavaScript results and benchmark protocol](docs/Comparison.md) cover all seven
198
+ fixtures and explain the different algorithms. [Application measurements](docs/Applications.md)
199
+ report defect detection, false alarms and compression tradeoffs separately from speed.
200
+ Changing-image/reference-reuse workloads, startup, memory and browser measurements
201
+ have their own scopes; a repeated-pair Node result is not a universal speed guarantee.
202
+ [Run the interactive demo](demo/README.md) with Einstein samples or your own images.
203
+
204
+ ## Choose a profile
205
+
206
+ | Profile | Purpose |
207
+ | ------------------------ | ---------------------------------------------------------------------------- |
208
+ | **`gaussian` (default)** | Match the original authors’ Gaussian SSIM reference. |
209
+ | `weber` | Fast dense box windows, with the previous default pipeline. |
210
+ | `bezkrovny` | Coarse non-overlapping boxes and partial edge blocks. |
211
+ | `fast` | Historical separable Gaussian pipeline and preprocessing. |
212
+ | `original` | Historical direct Gaussian port, retained as a compatibility/reference path. |
213
+
214
+ Profiles are not numerically interchangeable. Gaussian weights, box weights,
215
+ preprocessing, stride and edge coverage affect scores. [Algorithms](docs/Algorithms.md)
216
+ explains what is equivalent and what differs.
217
+
218
+ By default, automatic downsampling uses the shorter dimension and `maxSize: 256`;
219
+ this is a scale parameter, not a strict size cap. Set `downsample: false` to inspect
220
+ every full-resolution window. Sliding windows must fit after scaling.
46
221
 
47
- If you run into any issues or want a more info, check the [wiki](https://github.com/obartra/ssim/wiki).
222
+ Upgrading from 3.x? The default now prioritizes author-reference fidelity. Review
223
+ thresholds, or select `{ ssim: 'weber' }` to retain the previous default pipeline.
224
+ See [Migration](docs/Migration.md).
48
225
 
49
- The code is fully documented but feel free to create an issue [here](https://github.com/obartra/ssim/issues/new) if you have any questions.
226
+ ## Choose the right tool
50
227
 
51
- ## 🏁 Metrics
228
+ Use SSIM.js for Gaussian reference fidelity and numeric local maps across Node and
229
+ browsers. [BlazeDiff SSIM](https://github.com/teimurjan/blazediff) also offers MS-SSIM
230
+ and alternative pooling choices. [@4bitlabs/ssim](https://github.com/32bitkid/4bitlabs.ssim)
231
+ offers sparse windows and reference reuse. [pixelmatch](https://github.com/mapbox/pixelmatch)
232
+ counts changed pixels instead. Their scores and workloads differ; see [Comparison](docs/Comparison.md).
52
233
 
53
- | Process | Status |
54
- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55
- | Code Quality | [![Code Climate](https://codeclimate.com/github/obartra/ssim/badges/gpa.svg)](https://codeclimate.com/github/obartra/ssim) [![Issue Count](https://codeclimate.com/github/obartra/ssim/badges/issue_count.svg)](https://codeclimate.com/github/obartra/ssim) |
56
- | Versioning | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![npm](https://img.shields.io/npm/v/ssim.js.svg)](https://www.npmjs.com/package/ssim.js) |
57
- | Dependencies | [![Known Vulnerabilities](https://snyk.io/test/github/obartra/ssim/badge.svg)](https://snyk.io/test/github/obartra/ssim) [![DavidDM](https://david-dm.org/obartra/ssim.svg)](https://david-dm.org/obartra/ssim) |
234
+ ## Validation and contributing
58
235
 
59
- ## 💡 Credits
236
+ [Validation](docs/Validation.md) covers published scores, full maps, native Node
237
+ coverage, package consumers and browser engines. [Contributing](CONTRIBUTING.md)
238
+ explains the checks and existing [individual CLA](CLA.md).
60
239
 
61
- This project is a direct port of algorithms published by [Wang, et al. 2004](/assets/ssim.pdf) on "Image Quality Assessment: From Error Visibility to Structural Similarity". The original Matlab scripts are available [here](https://ece.uwaterloo.ca/~z70wang/research/iwssim/) with their datasets. To view the steps taken to validate `ssim.js` results, check the [wiki](https://github.com/obartra/ssim/wiki/Results-Validation).
240
+ Based on Wang et al. (2004), _Image Quality Assessment: From Error Visibility to
241
+ Structural Similarity_ ([paper](assets/ssim.pdf), [reference](https://ece.uwaterloo.ca/~z70wang/research/iwssim/)).
242
+ Dan Weber’s implementation and third-party attributions remain in [LICENSES](LICENSES).
243
+ [MIT](LICENSE).