Coding 2025-03-27
Whoops, I figured out what was wrong with the dithering stuff I was testing. I was attempting to set up an exponential moving average, and I wasn't properly setting it up. Since figuring that out, I've found out or worked out a few other things:
- The current implementation seems to work okay for photos, and a high alpha value makes text look interestingly crunchy, while low alpha values make text look smooth, and can unlock The Forbidden Edge Detection on photos.
- On reflection, it should be possible to abstract the averaging algorithm out of the dithering function, and pass it in. Possibly also the space-filling curve generator. (While I'm at it, it'd be nice to be able to tweak the threshold in the space-filling curve generator, or even change the algorithm.)
- I've been testing the prototypes just in Python's REPL, and I think I should switch over to using notebooks.
- I've downloaded a bunch of stock photos to experiment with, instead of the not-stock images I was messing with before.
My basic plan at this point is:
- Abstract out the averaging algorithm.
- Make a notebook for testing out different algorithms and parameters, and prototyping helper functions that I wish I'd had like a week ago.
- Figure out what I'm doing wrong when it comes to Bayer dithering.
- Implement more algorithms: different forms of moving average, different space-filling-curve thresholds, different space-filling-curve generators, matrix-based ordered diffusion, blue noise generation finally.
- Somewhere in all of this, make some kind of pipeline object.
For now, I'm going to think about how to factor out the averaging algorithm, because I tend not to do much with the send() method in Python.
Good night.