@wsanders At least with respect to the LCD library: The only function implemented so far to manipulate whole images is drawBitmap. drawJpg and drawJpgFile are commented out in https://github.com/m5stack/M5StickC-Plus/blob/master/src/M5Display.h so I assume they aren't working yet.
So my workflow for now is:
Save the image from gimp in gimp's ".h" format. This is smaller than a xpm or bmp. You will get a static char *data structure of all the pixels in the image. The .h file includes a macro to extract the pixels:
#define HEADER_PIXEL(data,pixel) {
pixel[0] = (((data[0] - 33) << 2) | ((data[1] - 33) >> 4));
pixel[1] = ((((data[1] - 33) & 0xF) << 4) | ((data[2] - 33) >> 2));
pixel[2] = ((((data[2] - 33) & 0x3) << 6) | ((data[3] - 33)));
data += 4;
}
Write your own function rgb888to565 to compress the pixels into a uint16_t.
Draw a bitmap of the image as fast as you can:
#include <M5StickCPlus.h>
#include "1.h"
int pixel[3];
// pointer fu to preserve the start of .h data
char *datastart;
uint16_t *bitmap;
void setup() {
M5.begin();
M5.Lcd.setRotation(3);
bitmap = (uint16_t *)malloc(height * width * 2);
}
void loop() {
M5.Lcd.fillScreen(GREEN);
datastart = data;
for (int16_t y=0; y < height; y++) {
for (int16_t x=0; x < width; x++) {
HEADER_PIXEL(data, pixel);
bitmap[60*y + x] = rgb888to565(pixel[0], pixel[1], pixel[2]);
}
}
M5.Lcd.drawBitmap(0,0,width,height,bitmap);
data = datastart;
}
Or you can use the Sprite library, which works well.