Python script to convert svg image to byte array, of color depth = 4, and bit depth = 2
python script.py -i checkboxfalse_icon.svg -ih 34 -iw 34
The above command converts the image named checkboxfalse_icon.svg to c header of bit depth 2,and dimensions of 34x34 (iw and ih have default value of 24, and are not required)
#define CHECKBOXFALSE_ICON_H
#include "../../UI/Widgets/Icon2bit.h"
const Icon2bit checkboxfalse_icon = {34, 34, ImageDataFormat::Indexed2Bit, {RGB565(255,255,255), RGB565(128,128,128), RGB565(64,64,64), RGB565(0,0,0)}, (const uint8_t[]){0xf9, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xba, 0x1b, 0x55, 0x55, 0x55, 0x55, 0xe4, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xb, 0x0, 0x0, 0x0, 0x0, 0xe0, 0x1b, 0x55, 0x55, 0x55, 0x55, 0xe4, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xba, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x6f}};
#endif // CHECKBOXFALSE_ICON_H
python script.py -i all
The above command converts all the images (ending with _icon.svg) to c header of bit depth 2,and dimensions of 24x24