pixelmatix / AnimatedGIFs

MIT License
62 stars 34 forks source link

Sections of the GIF are disappearing #32

Closed Bryce-Toma closed 5 years ago

Bryce-Toma commented 5 years ago

I made a few hand-made gifs for the display and one of the four does not display properly. I am able to display 60+ gifs that I found online. The only one that is giving me problems is a GIF I hand-made. I am experiencing some "clipping" of the gif, where sections of it do not display. It only updates certain rows and/or columns of moving animations/LEDs. The portions of LEDs don't turn on when "FINALS" and "JOB REJECTION" and "MEMES" show up.

To try and fix it: 1a) Removed the red overlay (over-processing?) -> still failed. Still certain segments did not display 1b) Removed the closing and opening of the mouth aniation. Mouth just close -> still failed. " 2) Tried lowering the refresh rate in Arduino code (default Refresh rate is 90)

All the above solutions that I tried did not fix the issue. It's not a hardware issue because I am able to display a full 1024 LED output. I believe it lies within the clearing function of the software.

See the following file for the aforementioned problem GIF: BryMan

embedded-creations commented 5 years ago

There’s probably some bugs in the library that need to get tracked down and fixed, but in the meantime to try and get your gif working, go to Ezgif.com and run it through something that doesn’t significantly change the Gif but reencodes it

Mad182 commented 5 years ago

The GIF is optimized for smaller file size by making some unchanged sections of consecutive frames transparent.

You can see this if you split the GIF to frames without redrawing them.

split

You can use https://ezgif.com/optimize with optimization method Coalesce (unoptimize) as a workaround. Or run ImageMagick's convert command with -coalesce option in command line.

Bryce-Toma commented 5 years ago

@Mad182 and @embedded-creations, Thanks guys for your prompt replies! Those are some great ideas! Since I made the GIF in a separate program, I didn't even consider running it through ezgif.com. It's strange that the program that I was using optimized it though to make the file smaller by removing unchanged animations. Thank you, I didn't know "coalesce" was a workaround. And your solution fixed my problem! :D

Bryce-Toma commented 5 years ago

I ran the GIF through ezgif.com and applied "coalesce" as suggested by Mad182, and it did fix the portions of the frames that were not previously displaying. However, now some colors are being inverted for a very brief second or between transitional frames.

Blue -> Yellow. Yellow -> Blue. Orange -> Green, etc.

Attached is a link to a video of what I'm experiencing. https://drive.google.com/file/d/12rJEzxaQoCuA9VdgSyawxCRWsy70d3le/view?usp=sharing

embedded-creations commented 5 years ago

Try some other modes, not necessarily coalesce. I've noticed that not all modes in ezgif work properly with the AnimatedGIFs sketch.

Do the inverted colors show up when viewing the GIF on your computer?

Bryce-Toma commented 5 years ago

I'll do some experimenting! Thanks, for your observation and suggestion! No, the inverted colors do not show up when viewing the GIF on my computer. By running the GIF through the splitter via ezgif.com, I wasn't able to locate the color inversion either. splitter_ezgiff

Bryce-Toma commented 5 years ago

I was able to fix the issues, by applying two optimizations to the GIF: 1) coalesce (to unoptimize the image and fix portion display) 2) single color table (fix color inversion) The GIF now runs perfectly! Thank you, both, for your help! :)