Simple tool to change images into byte arrays for OLED displays

radiosparks

Active member
Just for your information,

Here is a neato-cool way to convert images into byte arrays (or arrays back into an images) for use with (monochrome) displays such as OLEDs.


image2cpp

LINK: https://javl.github.io/image2cpp/

CODE is standalone Open source and runs on a single web page.
GitHub: https://github.com/javl/image2cpp

Even though the page only mentions the other micro-controllers, the code can be exported as plain bytes.

Pictured below is the logo from my web site displayed on a 128X64 I2C OLED SSD1315. Used a PICAXE 08M2 for the demo.

KUDOS to Hippy for the core code to init the display.


25862
 

OLDmarty

Senior Member
Here is a neato-cool way to convert images into byte arrays (or arrays back into an images) for use with (monochrome) displays such as OLEDs.
Is there a preferred image format and size (pixel) limit? i couldn't get it to create any data from a gif, jpg or png monochrome icon etc, but the site doesn't tell me what it's expecting...

Maybe it only works on certain web browsers too ???????
 

radiosparks

Active member
I just tried different image formats. WEBP, JPG, GIF and PNG. All different scales. My browser is Firefox Developer 127.0b8 (64-bit)

You need to know which OLED processor you have, I'm using SSD1306 & SSD1315. The software setup will determine the bit orientation or draw mode of the display.

NOTE: The converter works better with clip-art than a real photo, and images in Black & White.

I just tinkered with it to find what worked with my displays. Oh, it also helps editing to simplify the image in Photoshop or similar software.

Storing this data in the PICAXE will eat up the limited memory space real fast. I recommend adding external memory.
I used a 24LC16B and only have room for 2 full images. There are larger memory like 24LC256 or 24LC512.


26084

26085
 
Last edited:

kfjl

Member
Using the on-line converter with firefox and ubuntu, I fed it this:

26086

and it spat out that:

26087

and 259216 bytes of data!
 
Top