Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is surprisingly difficult to get really crisp dithering on modern displays, you have to do it on the client to match 1-1 the user’s display. Notice that the pre-rendered examples on this page actually look a little blurry if you magnify them. This is not really a problem unless you really want the crispness of the original Mac screen.

A few years ago I got annoyed with this and made a little web-component that attempts to make really sharp 1-bit dithered images by rendering the image on the client to match whatever display device the user has.

https://sheep.horse/2023/1/improved_web_component_for_pixel-...



I rewrote my canvas library's "reduce-palette" filter last month to make it a lot more code-efficient (because: the library doesn't use web workers, WebGL, etc). But the main reason to go hunting for efficiencies was my (slightly unhinged) decision to do all the color distance calculations in the OKLAB color space.

Demo here: https://scrawl-v8.rikweb.org.uk/demo/filters-027.html


That’s cool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: