A while ago I mentioned I was experimenting with some ways of drawing icons on the Norns display. One avenue I’ve been exploring is an ultra-simplistic bitmap tool that just draws a binary array by pixel. It’s using an 8x8 grid at the moment and just loops through the array and decides whether to draw a pixel or not. I started by just writing an table in Lua like below, and used line breaks to eyeball where the pixels would draw:
local plus = {
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
}
function draw_glyph(glyph, x, y)
local px = x
local py = y
for i=1, 64 do
if glyph[i] == 1 then
screen.pixel(px, py)
screen.level(8)
screen.fill()
end
px = px + 1
if px > (x+7) then
px = x
py = py + 1
end
end
end
I then thought it might be less cumbersome to just make a little web tool to spit out those tables with a point and click interface like this:

At which point I realised if it’s output from tooling it may as well just be a one line string, changing the Lua code to this:
local smiley = "0000000000100100001001000000000001000010010000100011110000000000"
function draw_glyph_from_string(glyph_string, x, y)
local px = x
local py = y
for i=1, #glyph_string do
if string.sub(glyph_string, i, i) == "1" then
screen.pixel(px, py)
screen.level(8)
screen.fill()
end
px = px + 1
if px > (x+7) then
px = x
py = py + 1
end
end
end
Now I put that in front of myself, I suppose the tooling could be changed to use different shades of grey. Though in my mind 1 bit icons were fine, in the style of Susan Kare which I’ve always been fond of.
My question is: Is this an efficient way of drawing? Looping through a table of pixel values? It was my understanding that while we can read bitmap images from disk it was generally efficient due to hitting the filesystem.