Closed ilikecake closed 2 years ago
nice! could you by chance test this on a non-raspi?
The only other circuitpython device I have is the Trinket M0. Would that device work to test this? How would I get my modified version of the software on that device?
did it work on the trinket m0 before this change?
I have not tried with the trinket m0. I got this display to work with a project I am building with the Raspberry Pi. I don't have much time to work on it during the week, but I will try to wire up the trinket and see if I can get it to work.
I was going to wire up the Trinket M0, and realized that it would not work the way I thought. The Trinket M0 does not have access to the PIL library, right? This change only affects the image() function, which requires a PIL frame to decode. The only change that would affect a normal circuitpython device is the check for numpy. I guess I could try to test that bit, but it is a direct copy-paste from another of your repos. I do not have any other Linux SBCs that I can test this on. Let me know what you want me to do here.
kk not sure when we'll get to testing this but we'll have to do a hardware test before merge since it could break existing projects! for now ya can just keep using it on raspi :)
Using the
display.image(image)
function to convert a PIL image to the proper format to display is very slow. See here for a thread with information on the issue. Using numpy to convert the image data is quite a bit faster. I measured the time to call thedisplay.image(image)
with the current method, and with numpy. The execution time decreased from ~7.1sec to .014sec on a Raspberry Pi Zero W.Similar to this function, I added a check for numpy to the code, and if it is available, numpy is used to generate the frame data. If numpy is not available, the function should work the same way as before.