blurhash icon indicating copy to clipboard operation
blurhash copied to clipboard

C Implementation doesn't produce "best looking" blurhash

Open hannojg opened this issue 5 years ago • 3 comments

I have just compared the blurhash TypeScript module and the C module (I was about to write a blurhash node module based on the C implementation for performance). The two blurhashes from the modules look different:

C Implementation TS implementation (better)
Screenshot 2021-01-13 at 08 40 33 Screenshot 2021-01-13 at 08 39 23
Has a dark spot in the top left corner matches the image really well
LTEfiu4UEe-p0M-oxuRQnhtkRQR* UEE:Ct005i~C00^%%MIUr;%yMyNG^R9uRP%M

The original image used, with x: 4, y: 3 components: The original image used

Can someone explain the difference? Shouldn't the both modules create (nearly) the same output? I think that the result from the TS implementation looks better and the result from the C module should match this.

hannojg avatar Jan 13 '21 07:01 hannojg

Just a guess, but something tells me it either has to do with sRGB<->Linear color-space conversions or an issue with image addressing causing it to alias the color samples differently.

Wunkolo avatar Mar 16 '21 12:03 Wunkolo

typescript generate a larger hash(28 vs 36), it's strange

windrunner414 avatar Aug 19 '21 15:08 windrunner414