Closed jossi closed 10 years ago
Have you tried it with the test images?
Working for me:
$ pyssim test-images/test1-1.png test-images/test1-1.png
1.0
$ pyssim test-images/test1-1.png test-images/test1-2.png
0.998107055283
$ pyssim test-images/test1-1.png test-images/test2-1.png
0.673010007986
$ pyssim test-images/test1-1.png test-images/test2-2.png
0.648811237728
I am using 32-bit PNGs so maybe that is the problem? I will try with the test images
bash-3.2$ pyssim test1-1.png test1-2.png 0.998107055283
that works. But not my images.
Could you post your images?
Note that the images are visually identical, but not bit-by-bit identical. Using a similarity index ImageMagik script I get an index of 0.99884
I see what's happening. Your images are RGBA and the alpha channel is all 255 values and all transparent pixels are ignored.
Thanks for the prompt response. What to do then? Convert the PNGs to another format?
Converting the PNGs from 32-bit to 24-bit resolves it.
$ pyssim Car_source.png Car_ImageWarp.png 0.996363163123
Thank you!
I just looked up the PNG spec though and it says this:
An alpha value of zero represents full transparency, and a value of (2^bitdepth)-1 represents a fully opaque pixel.
So I'm thinking that we're using the wrong value for transparency. We should treat 0 as transparent and 255 as opaque.
Indeed...
Sent from my iPad
On Oct 10, 2013, at 8:22 PM, Jeff Terrace notifications@github.com wrote:
So I'm thinking that we're using the wrong value for transparency. We should treat 0 as transparent and 255 as opaque.
Closing this and opened #5 instead
No matter what two images I use the SSIM returned is always 1.0