..
Failed to load latest commit information.
mini updated function test for leds and accelerometer interrupt Jul 3, 2016
0_HaD_Mooltipass.h proper bitmap commit May 17, 2015
0_Mooltipass.img proper bitmap commit May 16, 2015
0_Mooltipass.png Revised logo #2 Sep 14, 2014
10_settings_screen.h proper bitmap commit May 16, 2015
10_settings_screen.img proper bitmap commit May 16, 2015
10_settings_screen.png proper bitmap commit May 16, 2015
11_left_arrow.h proper bitmap commit May 16, 2015
11_left_arrow.img proper bitmap commit May 16, 2015
11_left_arrow.png proper bitmap commit May 16, 2015
12_right_arrow.h proper bitmap commit May 16, 2015
12_right_arrow.img proper bitmap commit May 16, 2015
12_right_arrow.png proper bitmap commit May 16, 2015
13_pin_lines.h proper bitmap commit May 16, 2015
13_pin_lines.img proper bitmap commit May 16, 2015
13_pin_lines.png proper bitmap commit May 16, 2015
14_sleep_symbol.h proper bitmap commit May 16, 2015
14_sleep_symbol.img proper bitmap commit May 16, 2015
14_sleep_symbol.png proper bitmap commit May 16, 2015
15_find_login.h proper bitmap commit May 16, 2015
15_find_login.img proper bitmap commit May 16, 2015
15_find_login.png proper bitmap commit May 16, 2015
16_font_profont_18.img removing checkbook24 Feb 8, 2015
17_font_profont_24.img removing checkbook24 Feb 8, 2015
18_EN_US_keyb_lut.img finishing layout support Feb 8, 2015
19_FR_FR_keyb_lut.img finishing layout support Feb 8, 2015
1_login_select.h proper bitmap commit May 16, 2015
1_login_select.img proper bitmap commit May 16, 2015
1_login_select.png proper bitmap commit May 16, 2015
20_ES_ES_keyb_lut.img finishing layout support Feb 8, 2015
21_DE_DE_keyb_lut.img finishing layout support Feb 8, 2015
22_ES_AR_keyb_lut.img generating keyboard LUTs for backers Feb 8, 2015
23_EN_AU_keyb_lut.img generating keyboard LUTs for backers Feb 8, 2015
24_FR_BE_keyb_lut.img removing duplicate LUTs Feb 8, 2015
25_PO_BR_keyb_lut.img removing duplicate LUTs Feb 8, 2015
26_EN_CA_keyb_lut.img removing duplicate LUTs Feb 8, 2015
27_CZ_CZ_keyb_lut.img removing duplicate LUTs Feb 8, 2015
28_DA_DK_keyb_lut.img removing duplicate LUTs Feb 8, 2015
29_FI_FI_keyb_lut.img removing duplicate LUTs Feb 8, 2015
2_login_right_arrow.h proper bitmap commit May 16, 2015
2_login_right_arrow.img proper bitmap commit May 16, 2015
2_login_right_arrow.png proper bitmap commit May 16, 2015
30_HU_HU_keyb_lut.img removing duplicate LUTs Feb 8, 2015
31_IS_IS_keyb_lut.img removing duplicate LUTs Feb 8, 2015
32_IT_IT_keyb_lut.img corrected polish and italian keyboards Feb 9, 2015
33_NL_NL_keyb_lut.img removing duplicate LUTs Feb 8, 2015
34_NO_NO_keyb_lut.img removing duplicate LUTs Feb 8, 2015
35_PO_PO_keyb_lut.img corrected polish and italian keyboards Feb 9, 2015
36_RO_RO_keyb_lut.img removing duplicate LUTs Feb 8, 2015
37_SL_SL_keyb_lut.img removing duplicate LUTs Feb 8, 2015
38_FRDE_CH_keyb_lut.img removing duplicate LUTs Feb 8, 2015
39_EN_UK_keyb_lut.img removing duplicate LUTs Feb 8, 2015
3_yes_no_frame.h proper bitmap commit May 16, 2015
3_yes_no_frame.img proper bitmap commit May 16, 2015
3_yes_no_frame.png proper bitmap commit May 16, 2015
40_yes_no_frame_int_l.h proper bitmap commit May 16, 2015
40_yes_no_frame_int_l.img proper bitmap commit May 16, 2015
40_yes_no_frame_int_l.png proper bitmap commit May 16, 2015
41_yes_no_frame_int_r.h proper bitmap commit May 16, 2015
41_yes_no_frame_int_r.img proper bitmap commit May 16, 2015
41_yes_no_frame_int_r.png proper bitmap commit May 16, 2015
42_zzz_symbol_locked.h proper bitmap commit May 16, 2015
42_zzz_symbol_locked.img proper bitmap commit May 16, 2015
42_zzz_symbol_locked.png proper bitmap commit May 16, 2015
43_trailer.img inlining functions May 14, 2015
43_tutorial1.h proper bitmap commit May 16, 2015
43_tutorial1.img proper bitmap commit May 16, 2015
43_tutorial1.png proper bitmap commit May 16, 2015
44_tutorial2.h proper bitmap commit May 16, 2015
44_tutorial2.img Fixed tutorial May 18, 2015
44_tutorial2.png Fixed tutorial May 18, 2015
45_tutorial3.h proper bitmap commit May 16, 2015
45_tutorial3.img proper bitmap commit May 16, 2015
45_tutorial3.png proper bitmap commit May 16, 2015
46_tutorial4.h proper bitmap commit May 16, 2015
46_tutorial4.img proper bitmap commit May 16, 2015
46_tutorial4.png proper bitmap commit May 16, 2015
47_tutorial5.h proper bitmap commit May 16, 2015
47_tutorial5.img proper bitmap commit May 16, 2015
47_tutorial5.png proper bitmap commit May 16, 2015
48_tutorial6.h proper bitmap commit May 16, 2015
48_tutorial6.img proper bitmap commit May 16, 2015
48_tutorial6.png proper bitmap commit May 16, 2015
49_egg.h proper bitmap commit May 16, 2015
49_egg.img proper bitmap commit May 16, 2015
49_egg.png proper bitmap commit May 16, 2015
4_tick.img removing anims from code, new bitmaps May 5, 2015
4_tick.png removing anims from code, new bitmaps May 4, 2015
50_blank.h proper bitmap commit May 16, 2015
50_blank.img proper bitmap commit May 16, 2015
50_blank.png proper bitmap commit May 16, 2015
51_CZ_QWERTY_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
52_EN_DV_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
53_FR_MAC_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
54_FR_CH_MAC_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
55_DE_CH_MAC_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
56_DE_MAC_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
57_US_MAC_keyb_lut.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
58_trailer.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
5_cross.h proper bitmap commit May 16, 2015
5_cross.img proper bitmap commit May 16, 2015
5_cross.png proper bitmap commit May 16, 2015
6_information.h proper bitmap commit May 16, 2015
6_information.img proper bitmap commit May 16, 2015
6_information.png import bug and new bundle Aug 9, 2014
7_font_profont_10.img fix issue #141 Jan 24, 2015
8_insert_smartcard.h proper bitmap commit May 16, 2015
8_insert_smartcard.img proper bitmap commit May 16, 2015
8_insert_smartcard.png proper bitmap commit May 16, 2015
9_main_screen.h proper bitmap commit May 16, 2015
9_main_screen.img proper bitmap commit May 16, 2015
9_main_screen.png proper bitmap commit May 16, 2015
Makefile Switch to 1-bit per pixel fonts for profont (reduces flash use) Sep 29, 2014
README.md new logo Sep 4, 2014
bitmap.py updated bitmap script: use cmap header to know real pixel value May 16, 2015
bundle.img allow the get_login command to already specify the login Mar 18, 2016
bundle.py updated bitmap script: use cmap header to know real pixel value May 16, 2015
bundle_tutorial.img new main mooltipass bundle, integrating MAC LUTs May 15, 2016
bundle_tutorial_cz.img cz qwerty keyboard added Aug 26, 2015
bundle_tutorial_en_dvorak.img cz qwerty keyboard added Aug 26, 2015
fw_strings.txt allow the get_login command to already specify the login Mar 18, 2016
qr.py Improve help text for phrase Mar 29, 2014
win_command.txt new main mooltipass bundle, integrating MAC LUTs May 15, 2016

README.md

Creating bitmap headers for Mooltipass

The bitmap format supported by the OLEDMP library in the Mooltipass project supports bitmaps up to 256x64 pixels in size and 1, 2, 3, or 4 bits per pixel (greyscale).

To format a bitmap for use in the mooltipass project, you can use the GIMP GNU Image Manipulation Program (available for Linux, OSX, Windows, etc).

  1. Scale or crop the image so it fits within the 256x64 size limit or to the size you want it to be.
  2. Convert the image to grayscale (image->mode->grayscale)
  3. Convert the image to an indexed image (image->mode->indexed) and select either 2, 4, 8, or 16 colour levels (1-bit pixels, 2-bit, 3-bit, or 4-bit pixels).
  4. Export it as a C header file (file->export, then select the file type as a C header file).

This header file is then used as the input to bitmap.py to produce the final header file for use in the Mooltipass project.

./bitmap.py --help
Usage: bitmap.py [options]

Options:
  -h, --help            show this help message and exit
  -n NAME, --name=NAME  name for bitmap
  -o OUTPUT, --output=OUTPUT
                        name of output file (.img produces binary blob, .h
                        produces optimized header)
  -i INPUT, --input=INPUT
                        input header file
  -c, --compress        compress output
  -b BITDEPTH, --bitdepth=BITDEPTH
                        number of bits per pixel (default: 4)

Example conversion of a 256x64 image with 16 colours per pixel (4-bit pixels)

./bitmap.py -i 0_HaD_Mooltipass.h -o 0_HaD_Mooltipass_4bit.h -n 0_HaD_Mooltipass
Parsed header: 256x64
Image size: 4096 words
Wrote 0_HaD_Mooltipass_4bit.h

The output file is 0_HaD_Mooltipass_4bit.h, and the bitmap data structure in the file is called 0_HaD_Mooltipass (from the --name option).

Example with run-length compression:

Use gimp to convert this: alt text into HaD_Mooltipass.h.

Then use the bitmap.py python script to convert HaD_Mooltipass.h into had_mooltipass.h

./bitmap.py -i 0_HaD_Mooltipass.h -o 0_HaD_Mooltipass_4bit.h -n 0_HaD_Mooltipass -c
Parsed header: 256x64
Compressed image: 4096 -> 3124 words
Wrote 0_HaD_Mooltipass_4bit.h

In this case the count is the number of bytes used by the compressed bit image; 3.8KB. The amount of compression is very dependent on the image and how many horizontal runs of the same pixel are in the image. The best possible case would be a 8 to 1 compression. Compressed bitmaps also have the benefit of taking less time to display on the screen.

Example with run-length compression and outputing to binary blob

./bitmap.py -i 0_HaD_Mooltipass.h -o 0_HaD_Mooltipass.img -n 0_HaD_Mooltipass -c
Parsed header: 256x64
Compressed image: 4096 -> 3124 words
Wrote 0_HaD_Mooltipass.img

In this case, the output file is a binary blob suitable for passing to bundle.py

Creating a bundle of bitmaps and fonts to use on the Mooltipass

The OLEDMP library supports bitmaps and fonts stored in the Mooltipass's SPI FLASH. There is about 32KB of storage available for this purpose.

The bundle.py python script takes a list of bitmap and font image filenames on its command line and generates a single image that can be loaded onto the mooltipass using the Chrome plugin GUI.

./bundle --help
Usage: bundle.py [options] bitmap1 bitmap2 font1 bitmap3 font2
    note: a filename that contains word "font" will be stored as a font
          other files are stored as bitmaps

Options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output=OUTPUT
                        name of output file

If the filename of the input image has the word "font" in it then it will be treated as a font, otherwise the input will be treated as a bitmap.

Example

Using wildcards to specify all of the image files starting with the digits 0 through 8:

./bundle.py -o bundle.img [0-8]*.img
    0x0448: size 3849 bytes, bmap 0_HaD_Mooltipass.img
    0x1351: size 1553 bytes, bmap 1_login_select.img
    0x1962: size 333 bytes, bmap 2_left.img
    0x1aaf: size 333 bytes, bmap 3_right.img
    0x1bfc: size 83 bytes, bmap 4_tick.img
    0x1c4f: size 149 bytes, bmap 5_cross.img
    0x1ce4: size 149 bytes, bmap 6_cross.img
    0x1d79: size 2380 bytes, font 7_font_profont_10.img
    0x26c5: size 3324 bytes, font 8_font_checkbook_14.img
total size: 12153
Writing to bundle.img
wrote 12153 bytes to bundle.img

Combining two images and a font into a bundle:

./bundle.py -o mybundle.img 0_HaD_Mooltipass.img 7_font_profont_10.img 5_cross.img 
    0x0430: size 3849 bytes, bmap 0_HaD_Mooltipass.img
    0x1339: size 2380 bytes, font 7_font_profont_10.img
    0x1c85: size 149 bytes, bmap 5_cross.img
total size: 6378
Writing to mybundle.img
wrote 6378 bytes to mybundle.img