Closed missionfloyd closed 3 years ago
This is pretty slick. I tried to test it out on my EPD and noticed one odd issue. When display()
is called the _applyConfig()
method is always called to change the image based on the config information. Calling _filterImage()
is left up to the implementing driver classes. Some don't need it as the filtering is done in the EPD driver. BW only devices just pass the image object straight through. Any dithering effects will get bypassed in these cases.
Would it be better to use _applyConfig()
to do the image manipulation or should these effects just be skipped for certain devices?
Good point, I've gone ahead and done that.
You're definitely right about the amount of time some of them take - wow. I was watching usage too and it pegs the CPU (Rpi 4 as well) at 100% for quite a while. Still pretty cool to see the different effects on the same image though.
I'm going to play with this a bit more but looking pretty cool. Nice work adding this in.
Everything I tested with it worked. Interesting to compare the output between dithers using the same image. Also ran the library against SlowMovie for a bit just to confirm the base library still worked with defaults. I'm ready to merge unless you had some more changes?
I don't have any other changes right now.
Per https://github.com/TomWhitwell/SlowMovie/issues/75, this adds every dithering algorithm available in hitherdither.
Valid options for
dither
:floyd-steinberg
(usually the default)jarvis-judice-ninke
stucki
burkes
sierra3
sierra2
sierra-2-4a
atkinson
bayer
cluster-dot
yliluoma
none
floyd-steinberg
andnone
call_filterimage()
, passing the dithering mode to Pillow. The rest use hitherdither.Hitherdither is written completely in python, so some of these can be really slow. Bayer and cluster dot are fast, but the rest can take anywhere from several seconds to several minutes, depending on resolution and colors (tested on a Raspberry Pi 4.)
Bayer, cluster-dot, and yliluoma can be fine-tuned with the
order
andthreshold
options.threshold
defines the color snap threshold. Takes an RGB list, default is[128, 128, 128]
order
defines matrix size. Must be a power of 2, default is 8.order
defines dot size. Can be 4 (small dots, default) or 8 (large dots).Hitherdither actually accepts an order paremeter for the rest as well. It does something, but I'm not really sure what, so I've left it out for now.