This is fun. One suggestion.. rather than creating a canvas for each user using a querySelectorAll and a loop, I'd use an IntersectionObserver and only create the canvases as they scroll into view. That way the user's device won't need to create hundreds of elements when the code runs. let observer = new IntersectionObserver( (entries) => { entries.forEach((entry, i) => { if (entry.isIntersecting) { const p = 2; cons…
Thanks, Interesting idea. I'm a little sceptical of the performance improvement, but I suppose that depends what we mean by performance. Your strategy essentially trades a one time computation and DOM mutation with a continuous but lighter one with some added overhead. In this case I suspect the total power performance is worse over time; _however_ latency and UX should be _better_, since it removes the relationship…
Show HN: HN Avatars in 357 bytes
521–530 of 536 posts
Re: Show HN: HN Avatars in 357 bytes
#522Re: Show HN: HN Avatars in 357 bytes
#523Earlier quoted context omitted.
Thanks, Interesting idea. I'm a little sceptical of the performance improvement, but I suppose that depends what we mean by performance. Your strategy essentially trades a one time computation and DOM mutation with a continuous but lighter one with some added overhead. In this case I suspect the total power performance is worse over time; _however_ latency and UX should be _better_, since it removes the relationship…
I wonder how ` ` would compare to ` ` instead
This thread is a good perf test, I might give it a quick go.
Also as others mentions the pixelation style thing is now finally fully cross browser supported, which should make it easier to achieve nearest neighbour upscaling for url encoding.
[edit]
I underestimated how involved image format headers are!
Re: Show HN: HN Avatars in 357 bytes
#524Reply here if you just want to see how your username looks like, so we avoid noise and keep that Show HN on the top. comments are really interesting
Re: Show HN: HN Avatars in 357 bytes
#525Re: Show HN: HN Avatars in 357 bytes
#526Reply here if you just want to see how your username looks like, so we avoid noise and keep that Show HN on the top. comments are really interesting
Re: Show HN: HN Avatars in 357 bytes
#527Re: Show HN: HN Avatars in 357 bytes
#528Reply here if you just want to see how your username looks like, so we avoid noise and keep that Show HN on the top. comments are really interesting
Re: Show HN: HN Avatars in 357 bytes
#529Re: Show HN: HN Avatars in 357 bytes
#530Reply here if you just want to see how your username looks like, so we avoid noise and keep that Show HN on the top. comments are really interesting