-
jonas’
MattJ, blurhash calculated server-side or blurhash expected to be sent from the client?
-
Ge0rG
I'd say it should be part of the SIMS
-
MattJ
jonas’: I think either works - there are some advantages to client-side (sender)
-
Ge0rG
MattJ: what's the benefit of blurhash over a small BoB preview?
-
MattJ
Sender controlled preview doesn't necessarily cover the NSFW case without extra work
-
Ge0rG
the only difference between blurhash and preview is the resolution, right?
-
MattJ
Kinda, kinda not
-
MattJ
You can get away with lower resolution blurhash because of the blurring
-
MattJ
Preview at the same resolution would be blocky
-
MattJ
Very
-
Ge0rG
MattJ: most modern rendering algorithms will blur instead of blocking
-
MattJ
All blurhash algorithms blur, regardless of image type/etc.
-
Zash
All? There's more than one?
-
MattJ
Implementations
-
MattJ
Sorry, I have a baby in one hand and the other is multitasking between making lunch and typing
-
Ge0rG
MattJ: if we add a BoB into SIMS, we surely can demand it to be blurred up to the original image resolution ;)
-
Zash
And like a tiny very compressed jpeg image there
-
Zash
8x8 or smaller
-
MattJ
I really don't care if you want to spec the same effect a different way that works
-
MattJ
I am just trying to do stuff
-
MattJ
Currently that means I am not going to get everyone in a channel to upgrade their clients to one that sends a hash, but I have a bit of influence on the server sidr✎ -
MattJ
Currently that means I am not going to get everyone in a channel to upgrade their clients to one that sends a hash, but I have a bit of influence on the server side ✏
-
MattJ
Blurhash is well defined with multiple libraries available
-
Ge0rG
JPEG is well defined with multiple libraries available ;)
-
MattJ
If you can do better, I beg you to
-
Zash
Reviwe progessive JPEG! :)
-
jonas’
12:29:19 Ge0rG> MattJ: most modern rendering algorithms will blur instead of blocking Quality of blurhash isn’t comparable to linearly interpolated pixels of a low-res previow
-
Ge0rG
Zash: awesome idea! make the preview image the first layer of the progressive jpeg, that way we can skip some bits on the actual transmission!
-
Ge0rG
jonas’: this is exactly what I want to learn - what's the difference?
-
jonas’
https://blurha.sh/
-
jonas’
look at it
-
jonas’
technically, I think they use spherical functions or something like that and save the coefficients for those
-
jonas’
but I haven’t gotten around to look into it in more detail yet
-
Zash
From when I read the spec it sounded like one block of JPEG
-
Ge0rG
converting an image into an 8x8 px JPEG is a standard feature of any platform that supports JPEG images. Converting into blurha.sh... not so much
-
MattJ
The 4x3 JPEG file I made is 667 bytes compared to 28 bytes for the same image's blurhash
-
MattJ
and some things display it blocky, some do blur (but so far I haven't managed to find an image viewer that does blur and also allows unlimited zoom)
-
Daniel
That's one of these moments where actually studying that stuff at university would have been helpful. Because I don't really understand what blurhash is doing
-
Daniel
Need to ask my university buddies at some point
-
edhelas
I really like the idea behind blurhash, would be pleased to use it in Movim :)
-
Ge0rG
again, what's the actual benefit over a significantly downscaled picture?
-
Zash
Presumably that the "hash" is smaller.
-
Daniel
No jpeg overhead?
-
Daniel
The decoding / upscalling is specified?
-
Ge0rG
the jpeg overhead needs to be offset by the additional library overhead, though ;)
-
Ge0rG
okay, https://github.com/woltapp/blurhash/blob/master/Kotlin/lib/src/main/java/com/wolt/blurhashkt/BlurHashDecoder.kt doesn't look like a huge overhead ;)
-
Ge0rG
> We usually decode placeholders that are 32 or even 20 pixels wide, and then let the UI layer scale them up, which is indistinguishable from decoding them at full size.
-
Ge0rG
Heh.
-
Zash
Huh
-
edhelas
could be really nice to also use it for the avatars :)
-
jonas’
I’d question the "shell-safe" base83 encoding though. the character set contains $ and * and # and { and } and [ and ]
-
jonas’
not that it matters much
-
jonas’
Daniel, they essentially do what jpeg does
-
jonas’
I’m not quite sure why the rendering is that much better though
-
jonas’
maybe because they have more bits for the few pixels
-
Zash
Because it's done in JavaScript of course
-
jonas’
ah, probably because what jpeg would normally expand to just 8x8 pixels, they expand to more pixels, and they don’t do that linearly, but they evaluate the cosine functions the DCT gave
-
jonas’
that’s why it’s smoother than upscaling a 8x8 jpeg
-
lovetox
what i dont get
-
lovetox
ok there are librarys who let me get the hash from a picture
-
lovetox
but i dont see one that let me get a picture from the hash
-
jonas’
note, blurhash is a misnomer
-
jonas’
it’s not a cryptographic one-way hash function
-
jonas’
lovetox, https://github.com/halcy/blurhash-python here is an encoder and decoder thing
-
lovetox
where do you see the decode?
-
jonas’
https://github.com/halcy/blurhash-python/blob/master/blurhash/blurhash.py#L77
-
lovetox
hm yeah but this is some fork
-
lovetox
not the original project
-
lovetox
but good :)
-
jonas’
it’s linked in their readme
-
jonas’
I guess their decoders are all JS because web
-
lovetox
yeah hm the original project has it in c and only wraps in python
-
lovetox
also it lets me just pass a filename
-
lovetox
with this fork, i have to install PIL and numpy to even pass something to the lib
-
jonas’
which makes sense
-
jonas’
(the original C thing also is only an encoder)
-
lovetox
why does it make sense, i will never install numpy and PIL only to get a blurhash
-
lovetox
insane to me :)
-
jonas’
you need PIL to load image data
-
jonas’
you need numpy to efficiently calculate the DCT and do the inverse
-
lovetox
i dont think so, the c implementation doesnt need numpy so why should the python one
-
jonas’
you can do it in pure python, but it’ll be slow
-
lovetox
they should just add a decode method to the c version
-
lovetox
and nobody needs the pure python one
-
jonas’
I bet "PRs welcome"
-
jonas’
except that the C version has restrictions on the input file formats. e.g. they don’t support all JPEG and PNG variants
-
lovetox
or i save me the whole trouble with 3 thirdparty librarys
-
lovetox
and just show the same blurred out placeholder for all pictures
-
lovetox
this seems like a gimmick, i get that its nice for webpages with many pictures
-
lovetox
but for a messaging client where most of the time only one picture is on the screen
-
lovetox
i would not add all that stuff