portapack-mayhem/firmware/tools/bitmap_tools
2024-10-24 17:43:18 +02:00
..
bitmap_arr_reverse_decode.py transparent splash logo & fix tab widget color glitch (#2256) 2024-09-22 19:40:54 +02:00
make_bitmap.py LupusE's patch (#2300) 2024-10-15 15:01:19 +08:00
pp_bitmap_parser.py Add generator and parser for bitmap.hpp (#2313) 2024-10-20 20:19:33 +08:00
pp_png2hpp.py Fix output overflow at converting to hpp. Function is untouched. (#2320) 2024-10-24 17:43:18 +02:00
README.md Add generator and parser for bitmap.hpp (#2313) 2024-10-20 20:19:33 +08:00

bitmap is for icons, it's colorless and headless; splash and modal isn't using bitmap

Bitmap helper folder

The folder bitmap_tools contains scripts to convert icons in png format to the PortaPack readable format in bitmap.hpp.

Convert a folder contains one or more icon.png to one bitmap.hpp

The make_bitmap.py is the traditional helper, well tested. The folder with the icons is given as argument and generates the ./bitmap.hpp. This file needs to be copied to mayhem-firmware/firmware/application/.
The icon size needs to be a multiple of 8. The generated icon is black/white.

Convert bitmap array to icon.png

The bitmap_arr_reverse_decode.py takes an array from the bitmap.hpp and convert it back to a png.

Convert both ways

The pp_png2hpp.py is based on the privious scripts, as all in one solution.
With the --hpp bitmap.hpp file and the --graphics /folder_to/png_icons/ arguments, theis script will generate a bitmap.hpp.
Add the --reverse argument to generate png icons from the given bitmap.hpp.

Especially the reverse function got a parser, to automatic get the filename and size of the image.