Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference images and hashes for testing #38

Open
crozone opened this issue Feb 22, 2020 · 1 comment · May be fixed by #42
Open

Reference images and hashes for testing #38

crozone opened this issue Feb 22, 2020 · 1 comment · May be fixed by #42
Labels
enhancement New feature or request

Comments

@crozone
Copy link

crozone commented Feb 22, 2020

It would be good to have a canonical set of reference images (like the ones included in the testing projects), with a matching set of reference hashes for various component sizes (X and Y). This would greatly help with testing and verifying new implementations.

I'm currently implementing a C# port of BlurHash (BlurSharp), and am in the process of writing tests for the encode function. Using the colour Doughnut image pic2.png from the python testing project, I get differing results from the current implementations:

https://blurha.sh/: LSM=%_00?^H?OpV]R.E1R*X9R%bH
blurhash-python: LlMF%n00%#MwS|WCWEM{R*bbWBbH
BlurSharp: LlF?k*00?ZE2kQaejFM{WAocWBj?

My result is obviously wrong (incorrect average colour), but this highlights that it is difficult to test a new implementation when even the existing reference implementations return differing results that both look correct at a glance. Without running the image through all existing implementations, it is difficult to know which ones are correct.

@crozone crozone linked a pull request Feb 24, 2020 that will close this issue
@DagAgren
Copy link
Collaborator

(Copied comment from PR)

I'm not sure the algorithm is specified quite tightly enough to warrant creating references at the moment. Colour space conversions will affect the result slightly, and there is no specification of what exactly it should be, nor have I checked thoroughly that all implementations are strict enough about it.

The whole algorithm is all about rough approximations anyway, and I am not sure if such strictness is even desirable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants