PerceptualHash is quite different on version 14.7.0 vs prior versions. Expected? #1883
-
Hi, thanks again for a great library! (PS this is a similar post to #1720 which you helped me with!) I have observed that the The repo includes a single (public domain) image asset. I have then written some unit tests and generated the perceptual hash on:
All 3 package versions are present in the csproj for your convenience. I observe that the PerceptualHash does not change at all between 14.0.0 and 14.6.0 and the unit test However the unit test I am not sure if this is intended. I've observed pretty stable / negligible changes across versions over my years of using the NuGet, but this one stood out so I wanted to highlight it just in case it wasn't intended. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Thanks for reaching out and asking this question. This is expected because there have been a lot of changes inside ImageMagick 7.1.2-0.. When ImageMagick/ImageMagick#3950 was build a lot of fixes where made in the underlying logic of this method. |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks for the reply @dlemstra. I rely on the stability of the pHash for a bunch of business functions. Do you know if it's possible to have 14.7.0 compute a backward compatible hash? (I'm guessing not). Do you think it might be worthwhile me re-computing my library of hashes on the new version (i.e. do you see it remaining stable going forward given your knowledge of developments in ImageMagick itself)? Any advice would be most appreciated! |
Beta Was this translation helpful? Give feedback.
-
There is no way to get a backwards compatibility version of that method. As far as I quick understand some of the mathematical methods for image statistics that are used by PerceptualHash contained errors. These errors have been fixed and that resulted in the difference that you are seeing now. The changes inside ImageMagick took several weeks to complete and I do think it's stable now. So I do think that it would be wise to do a complete recalculation. The ImageMagick release that contains these changes was made on the 13th of July so there is some risk that someone with a lot of math expertise will tell us we are wrong. But on the other side will be the person that is responsible for those changes and they have a lot of math expertise. p.s. There was a small fix in 14.8.0 for arm64 incase you are using that. |
Beta Was this translation helpful? Give feedback.
There is no way to get a backwards compatibility version of that method. As far as I quick understand some of the mathematical methods for image statistics that are used by PerceptualHash contained errors. These errors have been fixed and that resulted in the difference that you are seeing now. The changes inside ImageMagick took several weeks to complete and I do think it's stable now. So I do think that it would be wise to do a complete recalculation. The ImageMagick release that contains these changes was made on the 13th of July so there is some risk that someone with a lot of math expertise will tell us we are wrong. But on the other side will be the person that is responsible for th…