generating arrays from bmp images?

Looking for a app to generate arrays from bmp images.

I have this image:

And want something like:

const char bmp_img[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x15};

Ideally a mac os app, but linux or windows is doable too, just a bit more messing around :slight_smile:

You’ll have to edit the settings to make sure the pixels are correct… or else the picture prints like it was dragged.

Here’s one:
With this one, you have to remove the top 5 bytes in the file created, they’re settings like, pixel X max, pixel Y max, how many bytes per pixel… some stuff like that.
http://www.random-i.com/NokiaLCD/

Second:
http://www.zipfelmaus.com/nokia6100lcd_en/

Third:
This one must be ran from the CMD line, do bmpdump -help and bmpdump -verbose for examples on how to use the program, I’ve used it quite a few times… never just black and white though.
http://www.xmoslinkers.org/node/355

Here’s examples of what it prints out… (using a color LCD instead, and an XMOS board as well… not required for the setup, but the XMOS offers 400MIPS!! That’s 20 times faster than the Arduino! I need the extra speed for when I try to implement video… Arduino would probably cry trying:D)
http://picasaweb.google.com/jmcglo13/XMOSXK1AndNokia6610LCD


And here’s the actual image I converted:

Look into pbm file format, which the gimp can handle

Thanks guys,

I found this little app Bitmap converter for mono and color LCD displays which works perfectly for black and white screens.

I put a smaller 1bit BMP through it to try on my little nokia screen and it threw out a nice .h file :sunglasses:

#include "nokia_3310_lcd.h"

unsigned char minimini [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x10, 0x00,
0x10, 0x08, 0x80, 0x38, 0x00, 0x2C, 0x00, 0x04, 0x1C, 0x20, 0x14, 0xA8, 0x12, 0x24, 0x0A, 0x34,
0x0A, 0x24, 0x1A, 0xE4, 0x1A, 0xE4, 0x0A, 0x14, 0x0A, 0x14, 0x0A, 0x24, 0x1A, 0x24, 0xA2, 0x0C,
0x02, 0x14, 0x0C, 0x00, 0x0C, 0x00, 0x04, 0x08, 0x10, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x30,
0x06, 0x20, 0x80, 0x20, 0x00, 0x28, 0x9B, 0x20, 0x10, 0x68, 0x20, 0xC8, 0x20, 0x48, 0x70, 0x05,
0xDA, 0x20, 0x20, 0x40, 0x20, 0x50, 0x2A, 0x44, 0x1B, 0xA8, 0x10, 0x28, 0x50, 0x08, 0xA8, 0x10,
0xA0, 0x10, 0xAB, 0x10, 0x28, 0x50, 0xA0, 0x10, 0x20, 0xA0, 0x00, 0x20, 0x20, 0x40, 0x30, 0x05,
0x70, 0x20, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF0, 0xAD, 0x90, 0x62, 0x08, 0xF2, 0x00, 0xF6, 0x00, 0xF4, 0x02, 0x78, 0x84, 0x69, 0x14, 0xE8,
0x10, 0xC9, 0x33, 0x48, 0x92, 0x64, 0x89, 0x30, 0xC1, 0x24, 0x49, 0xD0, 0x01, 0xD4, 0x00, 0xD1,
0x02, 0x50, 0x82, 0x28, 0x00, 0xC2, 0x88, 0x20, 0x41, 0xA0, 0x4A, 0x80, 0x50, 0x08, 0xC0, 0x11,
0x24, 0xC0, 0x2A, 0x80, 0x20, 0xCC, 0x10, 0x40, 0x94, 0x20, 0x08, 0xE0, 0x08, 0x20, 0xC8, 0x20,
0x08, 0x60, 0x08, 0x60, 0x88, 0x40, 0xD0, 0x20, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x33, 0x4C, 0x93, 0xFE, 0x20, 0xED, 0xD2, 0x0D, 0xF2, 0x04, 0xDB, 0x24, 0xDB,
0x00, 0xFF, 0x00, 0xB7, 0x48, 0xB6, 0x09, 0xF2, 0x6D, 0xD0, 0x3F, 0xD8, 0xB2, 0xED, 0x22, 0xD9,
0x06, 0xF0, 0x0F, 0xD0, 0x2D, 0xD2, 0x2D, 0xD2, 0x2D, 0xD2, 0x21, 0xD2, 0x21, 0x1C, 0xC3, 0x10,
0xF5, 0x08, 0xF4, 0x05, 0xD8, 0x24, 0xDA, 0x24, 0xD4, 0x2A, 0xD4, 0x2A, 0x54, 0xAA, 0x56, 0xA8,
0x56, 0xAA, 0x54, 0xAA, 0x55, 0xAA, 0x56, 0xA9, 0x16, 0xEA, 0x94, 0x2C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x03, 0x04, 0x03, 0x04, 0x0B, 0x14, 0x3B, 0xEC, 0xB7, 0x4B, 0xBD, 0x42,
0xBD, 0x42, 0xBD, 0x53, 0xAE, 0xF8, 0x83, 0x3C, 0x03, 0xBC, 0x03, 0x1C, 0x23, 0x9C, 0x0B, 0x34,
0x0B, 0x14, 0xAB, 0x14, 0x8A, 0x11, 0x8E, 0x91, 0x8E, 0x90, 0x0B, 0xD4, 0x0B, 0xC0, 0x4F, 0x48,
0x43, 0xCC, 0x43, 0x84, 0x6D, 0x82, 0x65, 0xA2, 0x45, 0x32, 0xC5, 0x72, 0xD1, 0x32, 0x11, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
0x1A, 0x35, 0x2A, 0x35, 0x6A, 0xB5, 0x6A, 0xD5, 0x7E, 0xDB, 0x74, 0x2F, 0x3B, 0x0E, 0x03, 0x07,
0x01, 0x03, 0x03, 0x01, 0x03, 0x03, 0x00, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
0x03, 0x00, 0x05, 0x03, 0x00, 0x02, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};

Nokia_3310_lcd lcd=Nokia_3310_lcd();

void setup()
{
  lcd.LCD_3310_init();
  lcd.LCD_3310_clear();
  
  lcd.LCD_3310_draw_bmp_pixel(0,0, minimini, 84,48);
}


void loop()
{
 
}

While I couldn’t get the pde to see the array in the .h, moving it to the pde worked fine, need to look into that a bit :slight_smile: