timendus / thumby-grayscale Goto Github PK
View Code? Open in Web Editor NEWA library to easily use grayscale on the Thumby
License: GNU General Public License v3.0
A library to easily use grayscale on the Thumby
License: GNU General Public License v3.0
Starting the BrightnessTest, at least in Fast Execute (menu launch not tested) will have a bright horizontal artifact roll down the screen and then become stable.
When using a grayscale Sprite
with thumbyGraphics
, it would be nice if it would just show the black and white version of the image. We've lost that compatibility in #5
See: main...speed
To be investigated. Is it now using the wrong blit function, since #5?
I got a thumby a couple weeks ago and when using the grayscale library, the image either flickers between two positions, or is just monochrome. It gives different results randomly, so I think it's a timing issue.
Observable in the BrightnessTest
MicroPython v1.19.1 on 2022-06-18; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>>
Traceback (most recent call last):
File "<stdin>", line 49, in <module>
File "thumbyGrayscale.py", line 401, in disableGrayscale
File "thumbyGrayscale.py", line 320, in init_display
TypeError: 'type' object isn't subscriptable
>
------------------------------------------------------
thumbyGraphics:
def drawSprite(self, s):
self.blit(s.bitmap, int(s.x), int(s.y), s.width, s.height, s.key, s.mirrorX, s.mirrorY)
thumbyGrayscale:
@micropython.native
def drawSprite(self, s):
self.blit(s.bitmap, s.x, s.y, s.width, s.height, s.key, s.mirrorX, s.mirrorY)
Thanks to Demod#0001 for finding this issue.
thumbyGrayscale should be a drop-in equivalent to thumbyGraphics but it also good to allow for the floats as Demod puts it: "I think the API should keep supporting float for x and y, in case in the future someone adds anti-aliasing or something like that". No doubt anti-aliasing would rock when you are working at 0.007K resolution! :D
For that device, 0 is off and 1 is lowest brightness.
Thanks to Unimatrix0 for sharing fix: "... the low brightness being broken can be fixed by simply changing brightnessVals=[0,28,127] in main.py and menu.py to brightnessVals=[1,28,127]"
We are expecting a similar fix to arrive here: https://github.com/TinyCircuits/TinyCircuits-Thumby-Code-Editor/blob/master/ThumbyGames/menu.py
As seen in the Brightness test on the Thumby (but not in the emulator)
Cobble616#9287 has a Thumby that seemed to need a pre frame time set to 883
https://discord.com/channels/898292107289190461/898292174410612787/1018617603901624330
If this get's merged.
TinyCircuits/TinyCircuits-Thumby-Code-Editor#71
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.