phoboslab / qoi

The “Quite OK Image Format” for fast, lossless image compression
MIT License
6.94k stars 330 forks source link

Suggestion - hash function testing... #246

Closed jedSavage closed 2 years ago

jedSavage commented 2 years ago

I understand why you're using primes in the hashing function, but I'm not entirely convinced that it results in fewer collisions. I think it may distribute closely related colors more evenly across the 64 index values, but overall there will probably be the same number of collision as if you just added the RGB values together and mod - which would increase performance if only slightly. I think it might be worth while to experiment with different SIMPLE methods of generating the hash using different types of images (e.g. logos vs photos vs digital art etc) to see what methods work best for each type of image and include those methods in the encoder as options to be used when encoding. The option used would need to be encoded in the header.

phoboslab commented 2 years ago

To quote myself from the readme:

The QOI format has been finalized. [...] There are a lot of interesting ideas for a successor of QOI, but none of these will be implemented here.

So, let me kindly redirect you to: https://github.com/nigeltao/qoi2-bikeshed :)