GIF to header (.h) generator for the ESP32 eTFT screens. [WIP]
Resize the gif or video and crop it with any tool for example with:
convert walk.gif -resize 25% walk-resized.gif
For example for a TFT display of 240x135 size:
ffmpeg -i video.mp4 -r 4 -vf scale=240:-1 video.gif
./eTFT-gif-converter.py -i <RESIZED_AND_CROPPED_ANIM.gif> -o <HEADER_NAME>.h
git clone https://github.com/alex-arce/esp32-etft-gif-converter.git
cd esp32-etft-gif-converter.git
cp example/starcraft.gif .
./eTFT-gif-converter.py -i starcraft.gif -o animation.h
You could be use the animation.h header generated like this:
#include "animation.h"
void loop() {
if(shutdown++ > 5) espDeepSleep();
for (int i = 0; i < frames; i++) {
tft.pushImage(
2, // x position
0, // y position
animation_width,
animation_height,
animation[i]
);
delay(120);
}
}
Full implementation example here
Thanks a lot to Antonio Vanegas - hpsaturn for his tests and his help :-D