Convert images to XBM for showing it on Arduino OLED screen

When I was making a code to show a menu on an Arduino OLED screen, I needed to convert pictures to a specific format for showing it on the screen. I’m sure there may be another easier way to do it easy, but this is the way I found.

For converting the pictures to XBM we need to use the convertio.co website. I don’t like too much because it has a limit of 10 pictures per day, but it’s the website that convert the pictures with less graphics mistakes.

We can import a PNG picture and export to XBM file, first we must edit our picture to have the specific resolution we need. I’m using icons with a resolution of 14×14 px.

 

For example, if we import this image (14×14 px the first one, and 96×96 px the second one to allow you to see it!) :

We will receive this as result:

This is how it looks on the screen:

 

This is how the code looks like:

 

Sometimes the picture can have some problem. I found another software that allows us to edit the XBM files in our computer. The Simple xbm Image Editor app is made in Python so we will need to install Python in our computer if we don’t have it yet.

With this software we can import the picture, adding or removing the wrong pixels and after that exporting it again as an XBM file.

 

Finally, if you are interested to find a lot of icons, I recommend you use Icons8, you can use the online version or the app for your computer, both are incredible because include a lot of icons. I use the Windows 10 pack icons, they have only one colour, so it’s perfect for an OLED screen.

Write your comment here