Bitmap to Array for use in graphics.drawImage() #5711
Replies: 1 comment
-
Posted at 2016-09-22 by @gfwilliams Did you see the docs on the Graphics library? http://www.espruino.com/Graphics There's some info at the bottom about getting a bitmap in a form Espruino can use - it should work on OSX, but if it doesn't let me know! Posted at 2016-09-22 by Wilberforce The xbm (X bitmap) format might be of use. It's monochrome and is like a declaration in c that you could convert to JavaScript, the output is text: https://en.m.wikipedia.org/wiki/X_BitMap
Posted at 2016-09-22 by @gfwilliams Actually I'll just have a go bodging up an online converter - give me a few minutes Posted at 2016-09-22 by Bennr @gfwilliams Argh! Another case of me not reading things properly, sorry! Yes, there is an example down there of course, AND a link to a base64 encoder. Derp! @wilberforce Thanks for the tip, I'll try that out as I'm getting some noise on my images at the moment. Posted at 2016-09-22 by @gfwilliams Tadaaa! http://www.espruino.com/Image+Converter (Not tested, but it sure looks ok) Posted at 2016-09-22 by Bennr @gfwilliams Looks good! However, I don't know if it's my setup or something else, but this image: Which gave this screenshot when uploaded: Makes this on my display: What do you think? When I display fonts, etc, it seems to work, and although there is some noise when I base64 encode images they seem to be ok too. Posted at 2016-09-22 by @gfwilliams Ahh, thanks! I got the bit order wrong - have a go now! That'll teach me for not testing it :) Posted at 2016-09-22 by Bennr Woohoo! Thanks! Posted at 2017-02-28 by hygy @gfwilliams Uh this is really cool! Thanks for it!!! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-09-22 by Bennr
Hello, I've been looking around for a way to generate an array to store images in for use on an OLED, and while there are lots of results on Google, I don't seem to be able to find anything suitable that works for me.
I have a monochrome bitmap that I would like to convert to an array that I can put on the Pico. It feels like it should be very simple, but I am not having much luck getting them to work. Any tips/ideas? I am using ImageMagick on os x if anyone has an idea on how to use that to achieve it.
Beta Was this translation helpful? Give feedback.
All reactions