pixelmatix / AnimatedGIFs

MIT License
62 stars 34 forks source link

instead of displaying the gif i only get a blue/white flash #41

Open jonathan-blimke opened 4 years ago

jonathan-blimke commented 4 years ago

Hello community, i appreciate any help, if you need more Information let me know.

So i have a really small Matrix only 6 x 5 leds, which has no equal numbers on the sides. Does that Matter?

Second: in loop i tried something like this: loop() { matrix->clear(); decoder.decodeFrame(); }

then the gif seems to zoomed in, however it does not been played correctly. Every pixel gets interpreted as about double the size. And a white flash appears after the gif is done playing.

If try: loop() { decoder.decodeFrame(); }

like it is suggested then i only see the white/blue-ish flash (mentioned in the titel) on the whole led matrix

jonathan-blimke commented 4 years ago

it also looks like it is displaying two frames at the same time

embedded-creations commented 4 years ago

Can you post your full sketch? (using Github Gist)

jonathan-blimke commented 4 years ago

yes of course. https://gitlab.fsi.hochschule-trier.de/blimkej/lights

embedded-creations commented 4 years ago

I see you're using @marcmerlin 's AnimatedGIFs fork, I'm not familiar enough with his code enough to help out, sorry.

marcmerlin commented 4 years ago

Honestly, there is very little info and it's more of a "please read and debug my code" :) 1) does your matrix work? 2) what code was it tested with? 3) you are using bits of my code, but mixed in different files (like main,cpp), it's nowhere close to what I wrote and tested 4) Did you run and tested https://github.com/marcmerlin/AnimatedGIFs ? If so, please do. 5) Or simpler, please run https://github.com/marcmerlin/AnimatedGIFs/tree/master/SimpleGifAnimViewer2

Until I get more details as to how your matrix is configured, how it's been tested to work, and how SimpleGifAnimViewer2 is failing, it's really a wild goose chase.

marcmerlin commented 4 years ago

that said, code that scales by 1.5x (not 2x), is there: https://github.com/marcmerlin/AnimatedGIFs/blob/54733fc90a794a46a4ee3e9c1c64c1ba85a717df/GifAnim_Impl.h#L82

jonathan-blimke commented 4 years ago

First of all, thank you very much @embedded-creations and @marcmerlin for your interest in my topic. Honestly it is true that there is a big lack of information, that i should provide in order to get your help.

Anyway My matrix is working, and it is displaying the gif atleast to a certain degree (colors and scaling are probably wrong). It is also possible to display correct bitmap arrays, which contain 4 digits hex color values, which are parsed into 5/6/5 RGB bitmaps. Tested was it with Adafruit_GFX's - drawRGBBitmap((int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) {...}

the code was tested with a .gif file i created myself within Photoshop making sure that the color depth is set to 8 Bit, and amount of pixels equals the numbers of LED's im using in my matrix.

I was not able to solve the Problem in the last few days, so i started working on a different solution to display gifs, by converting every into a .bmp files and then extract the rgb values into bitmaps which can be displayed like i said earlierer.

I am not expecting any further help from you guys, even tho id be greatfull to know what was wrong in my attempt to port https://github.com/marcmerlin/AnimatedGIFs/tree/master/SimpleGifAnimViewer2 example into my current project. But i dont know what Information would be usefull for you. Since there are no error's thrown it seems to doing what it should.

Thank you for your time.

marcmerlin commented 4 years ago

drawRGBBitmap does not display gifs, it only takes input from http://www.rinkydinkelectronics.com/t_imageconverter565.php like https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/google32.h

Before you port https://github.com/marcmerlin/AnimatedGIFs/tree/master/SimpleGifAnimViewer2 , did you get the existing code working as is? It's kind of important before you proceed further.

jonathan-blimke commented 4 years ago

I know that drawRGBBitmap does not display gifs, but i can transform the gif file data into the input parameters of the function. By converting every frame into a .bmp file and parsing the data and build RGB color hex values out of it. One condition to make that possible is that the number of pixels lines up with the number of leds.

I did not get the existing code working as it is. There were confusing include errors since im working with visual studio code and the platformio plugin. Probably wrong configuration on my side. But since i found a different way like i discribed in the beginning of this very post, i wont longer attempt to port.