Dither.dx #1052
Replies: 3 comments 4 replies
-
Whoah, that's super cool! Would you like to submit the code as an example? It would be best to add some extra commentary around the different methods, but this is already great. By the way, for image loading, you could consider either PPM (@duvenaud has an implementation that loads PPM images in #524). I was also thinking of writing a QOI image loader, since the format seems super simple and shouldn't be too difficult to write in Dex (+ it's lossless and usually achieves PNG-like compression ratios). |
Beta Was this translation helpful? Give feedback.
-
Lovely! TIL about ordered dithering. Now I see where that "vintage comic book" look comes from. +1 to Adam's suggestion to submit it as a code example if you have time. The expression
Then
and there'd be no runtime error path at all. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, glad you like it! Implementing the example above, we ran into issues trying to apply partial application involving implicit arguments:
I can open an issue, in case this isn't tracked already. |
Beta Was this translation helpful? Give feedback.
-
A fun hack together with @adrhill exploring basic image dithering in dex:
Full copy-pasteable code:
Dither.dx
Round 0: Creating a test image
Round 1: Threshold dithering
Round 2: Noise dithering
Round 3: Ordered dithering
Dithering a real image
For this we currently need to convert a chosen image to raw bytes first. Here's the Julia code we used to convert the common cameraman test image.
Back to dex:
Beta Was this translation helpful? Give feedback.
All reactions