Hi Jason Coon .

Hi @Jason_Coon . I ported your Gif decoder from Aurora/SmartMatrix to NeoMatrix (mostly because I needed tiled support and I don’t have SmartMatrix hardware).
I got it working on ESP8266 using the built in SPIFFS built in flash filesystem support, and on top of NeoMatrix/FastLED with my tiled array using parallel output.
The changes were minimal, but I do have an issue that does not seem to be due to my changes.
Could you look at my code to see if I did something wrong?https://github.com/marcmerlin/FastLED_NeoMatrix/tree/master/examples/espgifread
You can see my changes on top of your code, here:
https://github.com/marcmerlin/FastLED_NeoMatrix/commit/30312746e94dbaca6755b0726bdacda5a65c7ed4#diff-7cde85c8ae2af98a666d4d2ae05766c4
As you can see form the pictures, decoding works fine, but most of your demo pictures look wrong: the background is the wrong color (transparency problem?) and the colors are rendered wrong too, where you can see a hint of the image, but details are missed.

Interesting, the 4 animated gifs I added 32anim_* look fine:
https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/espgifread/data/gifs/32anim_balls.gif

All the Chasm* are very hard to make out and the Dino ones look better but not great. Do you have any idea why?
I’m sure the GIFs look ok for you on smartmatrix, but were you able to try them on any neomatrix screen?
Thanks, Marc

gifs/DinoRun9-4.gif dark green background shows as white
gifs/DinoRun9-3.gif background looks all white, dark trunk is too bright
gifs/DinoRun7.gif white background for mammoth is black, actually helps there
gifs/DinoRun2.gif white background is black, looks good

gifs/DinoRun3.gif white background is black, dark BG is white, looks bad
DinoRun3.gif[1] GIF 32x32 32x32+0+0 8-bit PseudoClass 32c 3.12KB 0.000u 0:00.000

gifs/DinoRun11.gif white background is black, looks good
DinoRun11.gif[1] GIF 32x32 32x32+0+0 8-bit PseudoClass 16c 1.84KB 0.000u 0:00.000

gifs/DinoRun10.gif looks ok, but the lines on the back are missing
DinoRun10.gif[1] GIF 32x32 32x32+0+0 8-bit PseudoClass 8c 2.04KB 0.000u 0:00.000

Watching this topic with deep interest…

@Darren_Hedlund I posted the code, you can go get it now :slight_smile: It seems to work perfectly fine for some GIFs anims, the ones I got from https://imgur.com/a/NuFRD . The ones I got from @Jason_Coon 's Aurora code, display pretty poorly, and I’m just not sure why.
It may just be something wrong with those GIFs, and if you use the ones from the link I just gave you, it’ll work well I think.

@Marc_MERLIN Awesome, thank you!!!

@Marc_MERLIN Okay, got it up on the 8266 and digging into this.

@Yves_BAZIN I think this code should also work out of the box on your ESP32/NeoMatrix TV (you’d just have to adjust the init and the coordinates for display), it may be worth giving it a shot :slight_smile:

@Marc_MERLIN i will try it

I turned the AnimatedGIFs example from the SmartMatrix Library into a generic class that’s not dependent on the SmartMatrix Library, and in the future hope to turn the AnimatedGIFs example into its own Arduino Library. As it is now you should be able to strip out the SmartMatrix-specific code from the .ino file, and put your NeoMatrix/FastLED code into the three Callback functions in the ino file.

Starting from the AnimatedGIFs sketch is probably an easier path than extracting the GIF decoder from Aurora, but it sounds like you’re pretty far down that path already.

@Louis_Beaudoin I’m actually already done, it didn’t take that long :slight_smile: but I’d love to know if those gifs from Aurora are displaying ok for some compared to the screenshots I posted.
I can also try your version to see if it works better. Thanks

@Louis_Beaudoin I ported your code to SPIFFS/NeoMatrix and basically it has the same exact display problem. Code: GitHub - marcmerlin/AnimatedGIFs: Animated GIFs on Teensy, ESP8266, ESP32 on top of FastLED::NeoMatrix, SmartMatrix::GFX, and SmartMatrix, using Sdcard, SPIFFS, and FatFS (FFAT)
Fetching file index #0
Selected file /gifs/32anim_flower.gif
=> good

Fetching file index #1
Selected file /gifs/32anim_photon.gif
=> good

Fetching file index #2
Selected file /gifs/bigbuck1.gif
=> colors wrong

Fetching file index #3
Selected file /gifs/explode2.gif
=> colors wrong

Fetching file index #4
Selected file /gifs/fight2.gif
=> colors wrong and hangs at the end of the animation

Where can I find the code for “matrix_show”?

SmartMatrix Library uses color correction (aka gamma correction) so the colors will look much more accurate on SmartMatrix vs Neomatrix unless they do some color correction also.

@Louis_Beaudoin matrix_show is FastLED::show()
Sorry, bonehead move, I forgot to upload config.h, done now.
but you’ll need NeoMatrix for things to work:

(which is what config.h calls)
It allows you to tile neopixel matrices in any way you’d like (just about) and gives you access to Adafruit::GFX backend (although that’s not used here).

You can enable “GIFDEBUG” in GifDecoder_Impl.h and “DEBUG_WAIT_FOR_KEY_PRESS” and step through the GIF, looking for exactly where a frame goes wrong, that might help. You probably will want to set a longer timeout in the .ino file so it doesn’t switch to a new file while you’re stepping through frames.

Is matrix_brightness = 32 lowering your color depth and dropping some of the more subtle colors in the GIFs, especially Chasm GIFs which are quite detailed?

@Louis_Beaudoin good question about brightness. I did try to increase it, but it’s not the issue. GIFS like chasm have some colors seemingly inverted, at least the background. See the pictures I posted at the top of this post.
As for stepping through the frames, they are all wrong for a given GIF. Other gifs like the anim* gifs I added, work perfectly. In other words, either all frames are bad, or all frames are good for a given GIF.
It’s a bit hard to describe beyond the pictures I already posted. Is there a chance you might have even a 16x16 neopixel matrix? (it would only display 1/4th of the GIF but it would be more than enough to show the color problem)

Grasping at straws here: try matrixleds[XY(x,y)] = CRGB(red, green, blue); for drawPixelCallback()

@Louis_Beaudoin I appreciate the time you’re spending to help, thank you.
I did matrixleds[XY(x,y)] = CRGB(red, green, blue); because why not, but indeed it’s still the same.
Basically bigbuck1.gif and explode2.gif show a white background with a hint of the gif on top of that.
To me, it really looks like the decoder is feeding the wrong RGB values. See my own anim* gif, returning X/Y RGB
0,0>0,0,0
1,0>0,0,0

Now, let’s see /gifs/bigbuck1.gif
0,0>123,127,119
1,0>135,141,116
2,0>129,144,127
3,0>140,147,126

123/127/129 RGB is pretty much white at half power, is it not?
That’s exactly what I see on those GIFs.
Is that not a problem with the decoder?

Patch:

  • matrixleds[XY(x,y)] = CRGB(red, green, blue);
  • Serial.print(x);
  • Serial.print(",");
  • Serial.print(y);
  • Serial.print(">");
  • Serial.print(red);
  • Serial.print(",");
  • Serial.print(green);
  • Serial.print(",");
  • Serial.print(blue);
  • Serial.println("");

What are the first four pixels of the GIF supposed to be, if you opened it in GIMP or another editor?

missing/deleted image from Google+

@Louis_Beaudoin
That’s chasm1.gif you included, probably a better example.
line #9 decoded, is below (it’s 2 lines above the blue dot for the eye)
Look at columns 7 to 11, they all decode as 255,207,170 which is both way too bright and wrong, there aren’t 5 pixels of the same color in the original picture on line 9
0,9>38,42,59
1,9>38,42,59
2,9>30,34,50
3,9>21,27,41
4,9>21,27,41
5,9>127,83,78
6,9>127,83,78
7,9>255,207,170
8,9>255,207,170
9,9>255,207,170
10,9>255,207,170
11,9>255,207,170
12,9>15,21,33
13,9>21,27,41
14,9>15,21,33
15,9>15,21,33
16,9>30,34,50