-
• #2
@Hank the BJS2 only supports 3bit color. The dots you can see are from dithering the remaining colors. http://forum.espruino.com/conversations/368893/
If you don't want that you can use the 8 solid colors (Black, White, Red, Green, Blue, Cyan, Yellow, and Magenta).
-
• #3
Is there a way to convert e.g.
var FLOORIMG = require("heatshrink").decompress(atob("iEKxH+kklABuLAAlgAAwNFB34OLmAAO0YAO5wAOA"));
to 3bpp without having the original png file?
Also if I change
b = Graphics.createArrayBuffer(178,178,8);
to
b = Graphics.createArrayBuffer(178,178,3);
I get
Uncaught Error: Invalid BPP
It looks fine in B/W though:
b = Graphics.createArrayBuffer(178,178,2,{msb:true}); var gimg = { width:178, height:178, bpp:2, buffer:b.buffer };
Edit:
I now understood that settingvar H = b.getHeight()-24; b.setColor("#ff0000"); b.fillRect(0,0,b.getWidth(),H-1);
instead of
var H = b.getHeight()-24; b.setColor("#71c6cf"); b.fillRect(0,0,b.getWidth(),H-1);
will stop dirthering, but how can I show some shade of grey? Is that not possible?
PS: I intended to let it run in full resolution - but that will be too slow. So I stopped developing that. I's be curious about the Grey thought :)
-
• #4
but how can I show some shade of grey? Is that not possible?
Not without dithering - because of the 3 bits.
On Bangle.js 2 you may not even need the separate buffer. In fact I just pushed an update to the development app loader which renders fullscreen, and direct.
Bangle.js 2's graphics aren't super fast at the moment (particularly the fill) - it's something I've been meaning to look at. Specifically if we were willing to throw away a bit of RAM (aligning to 4 bits, not 3) things get a lot easier!
-
• #5
Sacrificing a little memory to align to 4 bit sounds like a good compromise.
I tried to adjust https://banglejs.com/apps/?id=flappy so that it shows full screen on Bangle.js 2.
My code currently is:
However, the emulator shows these dots instead of a clear screen. Any hints?
1 Attachment