Structural SIMilarity

I propose some codes to compute the SSIM (Structural SIMilarity) [1][2], that is well known to evaluate either the quality of an image processing algorithm or the degradation suffered by an alteration process (impulse noise, JPEG compression, etc.).
To have an overview of SSIM, you should visit this website, linking to codes based on Matlab, OpenCV, etc. Here, you will find
The Python file ssim.py, that can also be viewed in this page.
An example of use of SSIM with this file main_ssim_2images.py, and the associated page.
You can also visit H.C.R. de Oliveira's page, proposing a new version of this code to images with more than 8-bits per pixels. The Python code is here:
https://github.com/helderc/src/blob/master/SSIM_Index.py.

References

[1] 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, 13(4):600--612, 2004.
[2] Z. Wang and A. C. Bovik. Mean squared error: Love it or leave it? - A new look at signal fidelity measures. IEEE Signal Processing Magazine, 26(1):98--117, 2009.