jterrace / pyssim

A Python module for computing the Structural Similarity Image Metric (SSIM)
MIT License
340 stars 62 forks source link

Wrong transparency value #5

Open jterrace opened 10 years ago

jterrace commented 10 years ago

PNG spec says:

An alpha value of zero represents full transparency, and a value of (2^bitdepth)-1 represents a fully opaque pixel.

So we're using the wrong value for transparency. We should treat 0 as transparent and 255 as opaque.

jterrace commented 8 years ago

I'm not sure if SSIM actually says anything about what to do with an alpha channel. We can remove entirely transparent values (alpha==0) but the SSIM metric is going to treat partial transparency as if it was fully opaque.