Change color of MDI icons in animimg

I’ve been unable to find a way to change the color of an animimg widget that uses MDI icons from anything other than the default black.

I’ve tried image_recolor with no effect. I was also thinking that I may be able to apply the color at the time of upload via the image: section, but I’ve tried BINARY and GRAYSCALE, again no good.

Any help would be appreciated! I’m almost at the ‘save each frame as a PNG with the correct color and size’ stage, very inelegant.

Well slightly more elegant is to save it in a GIF and use set_frame() or prev_frame(), next_frame() to change it:

https://esphome.io/components/animation

Thanks @zoogara - but then I’d also have to set up an Interval component to take care of the frame calls… doable of course, and if the animimg/MDI icon combo simply doesn’t support color-changing from black, which I can’t really believe, it might be the way forward…

Ah - wasn’t paying attention - you’re using LVGL.

Remember this only a subset of the LVGL standard - there’s no guarantee it will work as expected. :smiley:

1 Like

Did you set image_recolor_opa to COVER?

1 Like

Amazing! I had not. That’s great @clydebarrow, thanks for the quick assist!

2 Likes