Image to Bitmap Converted

Hi!
I need an extension, that can convert any image to monochrome bitmap. I have zero experience in java. Basically, I will upload an image, that will get converted into bitmap string, that I will send to esp32 in chunks, and it will display on a oled or ePaper.

Any help will be appreciated.

Thank you!

Hi Saikat,

Have you tried searching in the community or in Taifun’s extension index? App Inventor Extensions | Pura Vida Apps

Edit:
This one has a function to apply a grayscale filter.

As for the conversion, I’m having trouble finding an extension, you should rely on web APIs or possibly use JavaScript via the Web Component.

Is there no way for you to send it to the ESP32 in a different format? Sorry, I’m not very experienced.

Hi @RaYzZz, thanks a lot for your reply. To transfer an image to microcontroller, it need to be converted into string (base64, BMP are the popular one). I have already tried converting into base64 with the help of KIO4_Base64, but there are certain limitations with the Library that I have been using on ESP32 to convert back to image from base64 (mainly memory related, as it has only 520kb of RAM).
So the easiest way for me to go with raw 1 bit BMP.
I will try to figure out using web APIs & JS as you mentioned.

Once again, thanks for assisting! ;D

You can try this Extension and give me feedback about it :


com.mrkoder.imageconverter.dev.imageconverter.aix (11.9 KB)

2 Likes

Hi @_Ahmed; thanks for your reply; surely I’ll try it. Also I managed to convert image to bitmap with the help of webviewer and javascript.

@_Ahmed Just tried your extension, and honestly I loved it!
Very much helpful and it is really nice to see you have implemented floyd steinberg dithering; that reduces the work load on ESP32. Really nice work!

Thanks a lot!!!

1 Like

You are welcome @C.Saikat
I am pleased that this extension helps you !

If you ever want to add more features, some ideas :

  • Atkinson dithering (popular for ePaper, slightly different look)
  • Resize modes (fit, fill, stretch)
  • Color OLED support (565 RGB format)
  • Preview function (return a preview image before sending)
    I can do this .
    thanks .

Hi @_Ahmed sorry for the late reply. It would be really great if you add those features as well! For now I am already using TaifunImage for other task in the app, so I am resizing with it only. Also ur extensions ‘targetWidth & Height’ is already enough, but it’s gonna be amazing if u can add Preview image return and scaling options (fit fill stretch).
And also if you need any help in hardware & microcontroller side stuffs, feel free to connect with me.

1 Like