Getting Your Bitmaps Converted for Simple Display in Your Firmware

Getting Your Bitmaps Converted for Simple Display in Your Firmware

Perhaps you finally got a snazzy display for your latest project. I highly recommend the AdafruitGFX library as well as GIMP, and for making your own fonts, MikroElcktronika GLCD Font Creator (optional and not covered here).

If you are looking for a project to get you started, AdaFruit has a lovely wearable project.

Setup

  • GIMP
  • Access to your lovely bitmaps

Process

  1. Open the target bitmap into GIMP.
  2. Assume it is trimmed to the size you desire.
  3. Take note of the dimensions of the bitmap
  4. From the GIMP menu, select Colors->Rearrange colormap so it is appears a below (BLACK = 1; WHITE = 0) and click OK.

map2

  1. Select from the menu Image->Mode->Indexed. Choose 1-bit palette and click “ Dithering is optional.

dialog

  1. Save the file by selecting File->Export As. Choose c header file (.h) and name appropriately. Now use this however needed in your required firmware infrastructure. Personally, I make sure everything is “const” and indexable with sizes and offsets.Here is an example(rebelbot_bw.h).