{"id":216,"date":"2015-05-26T17:24:24","date_gmt":"2015-05-26T17:24:24","guid":{"rendered":"http:\/\/www.rebelbot.com\/blog\/?p=216"},"modified":"2015-05-26T17:36:00","modified_gmt":"2015-05-26T17:36:00","slug":"216","status":"publish","type":"post","link":"http:\/\/www.rebelbot.com\/blog\/216\/","title":{"rendered":"Getting Your Bitmaps Converted for Simple Display in Your Firmware"},"content":{"rendered":"<p>Perhaps you finally got a snazzy display for your latest project. I highly recommend the <a href=\"https:\/\/learn.adafruit.com\/adafruit-gfx-graphics-library\">AdafruitGFX library<\/a>\u00a0as well as GIMP, and for making your own fonts,\u00a0<a href=\"http:\/\/www.mikroe.com\/glcd-font-creator\/\">MikroElcktronika GLCD Font Creator<\/a>\u00a0(optional and not covered here).<\/p>\n<p>If you are looking for a project to get you started, AdaFruit has a lovely wearable\u00a0<a href=\"https:\/\/learn.adafruit.com\/steampunk-cameo-necklace\/overview\">project.<\/a><\/p>\n<h2>Setup<\/h2>\n<ul>\n<li>GIMP<\/li>\n<li>Access to your lovely bitmaps<\/li>\n<\/ul>\n<h2>Process<\/h2>\n<ol>\n<li>Open the target bitmap into GIMP.<\/li>\n<li>Assume it is trimmed to the size you desire.<\/li>\n<li>Take note of the dimensions of the bitmap<\/li>\n<li>From the GIMP menu, select <strong>Colors-&gt;Rearrange colormap<\/strong> so it is appears a below (BLACK = 1; WHITE = 0) and click OK.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/map2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-221\" src=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/map2.png\" alt=\"map2\" width=\"711\" height=\"617\" srcset=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/map2.png 711w, http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/map2-300x260.png 300w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/a><\/p>\n<ol start=\"5\">\n<li>Select from the menu <strong>Image-&gt;Mode-&gt;Indexed<\/strong>. Choose <strong>1-bit<\/strong> palette and click \u201c<strong>\u201d<\/strong> Dithering is optional.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/dialog.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-217\" src=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/dialog.png\" alt=\"dialog\" width=\"485\" height=\"479\" srcset=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/dialog.png 485w, http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/dialog-300x296.png 300w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/a><\/p>\n<ol start=\"6\">\n<li>Save the file by selecting <strong>File-&gt;Export As.<\/strong> Choose <strong>c header file (.h) <\/strong>and name appropriately. Now use this however needed in your required firmware infrastructure. Personally, I make sure everything is &#8220;const&#8221; and indexable with sizes and offsets.Here is an example(<a href=\"http:\/\/www.rebelbot.com\/blog\/wp-content\/uploads\/2015\/05\/rebelbot_bw.h\">rebelbot_bw.h<\/a>).<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Perhaps you finally got a snazzy display for your latest project. I highly recommend the AdafruitGFX library\u00a0as well as GIMP, and for making your own fonts,\u00a0MikroElcktronika GLCD Font Creator\u00a0(optional and not covered here). If you are looking for a project to get you started, AdaFruit has a lovely wearable\u00a0project. Setup GIMP Access to your lovely &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.rebelbot.com\/blog\/216\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Getting Your Bitmaps Converted for Simple Display in Your Firmware&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":225,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","itunes_episode_number":"","itunes_title":"","itunes_season_number":"","itunes_episode_type":"","footnotes":""},"categories":[19,3,1,17],"tags":[],"class_list":["post-216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-geek","category-hardware","category-uncategorized","category-wearables"],"_links":{"self":[{"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":6,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":226,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions\/226"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/media\/225"}],"wp:attachment":[{"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.rebelbot.com\/blog\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}