pixelmatix / AnimatedGIFs

MIT License
62 stars 34 forks source link

Colors are different when played on the Display #46

Closed TeensyWeensySpider closed 2 years ago

TeensyWeensySpider commented 2 years ago

Hello, I bought a Teensy 4.1 and thought this would be a great library to use with it since the Teensy 4.1 has an onboard SD card slot. I bought a SmartMatrix V5 shield for the Teensy and it works great and the display works as intended. I then decided to try displaying GIFs so I made the test GIF featured below in Aseprite, a sprite animation software. My display is 128 x 32 pixels and I sized the GIF accordingly. color_test So I put the GIF into a gif folder on the Teensy's SD card and displayed it on the matrix and encountered some glitches as you will see from the images below. The red and white text was red and white as it should be but it seems the green and blue and the magenta and yellow were switched around. Not only that but there were these weird glitches where the text would overlap with other text. sketch-1647832952220 sketch-1647832901361 sketch-1647832820762 sketch-1647832998310 sketch-1647833059429

My code is the AnimatedGifs example code that was provided in the SmartMatrix Library except for changing my display size to 128 x 32 and uncommenting the #include

embedded-creations commented 2 years ago

The color swap issue could come from a couple places. Can you run some SmartMatrix Library example sketches to make sure the colors look right? You could run Bitmaps, comparing what you see to the bitmaps in the sketch folder.

The glitches could come from the GIFs being encoded in a way that the decoder can't handle. The easiest thing might be to use ezgif.com to reencode the GIFs and see if they now work with out glitching

TeensyWeensySpider commented 2 years ago

I went through the example bitmaps like you said and noticed the chrome logo looked different. It has the same problem with my GIFs. The chrome logo's yellow iris was magenta and the green iris was blue. Any idea what could cause this color swap?

embedded-creations commented 2 years ago

https://github.com/pixelmatix/SmartMatrix/wiki/MatrixHardware-Header#how-to-swap-color-order-on-hub75-connector

TeensyWeensySpider commented 2 years ago

Thank you, that seemed to do the trick and my gif is displaying correctly after re-encoding it in eazygif. I did however have one more problem though and wanted to ask you if this was normal. PXL_20220322_231913574 MP Some of the square groups of 16 x 16 pixels in the demo were less bright than others like on the left and bottom side of this photo, compared with the brighter right side ones.

embedded-creations commented 2 years ago

Is it specific to the panel, e.g. the light and dark spots stay on the same panel if you change the panel order?

TeensyWeensySpider commented 2 years ago

I switched the panels around and the darker 16x16 squares didn't change position. If the matrix displays fully white the spots disappear. Text also does not appear to be affected by the darker spots either. I should also note I am using two P2.5mm panels.

embedded-creations commented 2 years ago

Can you change the refresh rate in the sketch to something lower? The default on the Teensy 4 is 240Hz. Try 120 at first. See FeatureDemo code for how to change the refresh rate.

You could also try to change the brightness (make brighter), or color depth (set lower, like 24 instead of 36). All those parameters can change the width of the shortest "on" pulses sent to the panel.

TeensyWeensySpider commented 2 years ago

I changed the brightness to 99% instead of 100% and it got rid of the dark areas I very much appreciated the help! Thank you again, you are awesome!

embedded-creations commented 2 years ago

I don't know why that worked, but I'm glad that it did!