Go Down

Topic: SSD1306 I2C OLED - Muybridge Animation (Read 6767 times) previous topic - next topic

stievenart

#15
May 08, 2016, 09:05 pm Last Edit: May 09, 2016, 02:39 am by stievenart Reason: added another animation
The old TVout library has a demo of a spinning 3D wireframe cube
https://github.com/cbmeeks/arduino-tvout/blob/master/examples/DemoPAL/DemoPAL.pde

I'll bet your library doesn't have a wireframe of a spinning dodecahedron...

See spinning dodecahedron animation at: http://youtu.be/y-KIPsp4hps

I made a second dodecahedron animation with perspective by rotating the bottom elliptical path opposite to the top three paths.

Dodecahedron animation with perspective at: https://youtu.be/VPEzzP9_Wyc

zoomx

#16
May 09, 2016, 09:51 am Last Edit: May 09, 2016, 09:52 am by zoomx
Well done!


It's not my library. I have a copy of it in github (but the link is not my copy) because the original repository is on Google Code that has closed.



Anyway Claus Ilginnis made a better work fixing more bugs here
http://sourceforge.net/projects/arduino-tvout/
But there is not any spinning dodecahedron!
See the spinning cube here
https://www.youtube.com/watch?v=E0E85EEyxMc
from 0:55. The rotation is not limited on one axis.

bitbank

#17
May 22, 2018, 02:33 pm Last Edit: May 23, 2018, 06:35 pm by bitbank
I just started exploring this subject and decided to go in a different direction. I created a Mac/Linux program to take animated GIFs and turn them into a compact form that's easy to play back (my own byte oriented compression). The player code doesn't need any RAM and runs well on an ATtiny85. I'm currently documenting everything and will release it as open source soon. Anyone interested can contact me with suggestions/requests before I publish it.

Here's a video of it running a short animation on an ATtiny85:

Youtube Video

I just added a blog post about it:

Practical animation on I2C SSD1306 displays
Library? We don't need no stinkin' library...we write our own

zoomx

Interesting!

Maybe you can consider cheap MCU like the STM32F103 (bluepill but STM32F4 series also!) or the ESP8266 for bigger animations!

david_prentice

I am very impressed with decoding a GIF with a tiny85.

We look forward to your posts.

David.

zoomx

It does not decode a GIF but a format developed by him.
I created a Mac/Linux program to take animated GIFs and turn them into a compact form that's easy to play back (my own byte oriented compression). The player code doesn't need any RAM and runs well on an ATtiny85.

david_prentice

Yes,   I am aware of that.    But I suspect that he has a pretty good knowledge of how to decode a regular GIF.

It would be interesting to know if it can be done with Uno-size SRAM.

Yes,   I am sure that you can invent a special format.    But you would need to process every standard GIF into this special format before you use it.    Not as convenient as using standard PC tools like IrfanView.

David.

bitbank

Yes,   I am aware of that.    But I suspect that he has a pretty good knowledge of how to decode a regular GIF.

It would be interesting to know if it can be done with Uno-size SRAM.

Yes,   I am sure that you can invent a special format.    But you would need to process every standard GIF into this special format before you use it.    Not as convenient as using standard PC tools like IrfanView.

David.
As I state in my blog post. No AVR MCU has enough RAM to decode a GIF. LZW compression needs a dynamic dictionary with 4096 entries and multiple pointers/flags for each entry. Animated GIF requires additional RAM to hold the previous frame. Neither of which is possible with less than 32-64k of RAM. My solution is a practical way to leverage the numerous animated GIF tools to easily create complex animations to run on AVRs. The other side of my project is that my code allows the "slow+cheap" I2C version of the SSD1306 to become practical for doing fast animations. 
Library? We don't need no stinkin' library...we write our own

zoomx

It is the same also for small GIF?
Because Bodmer was able to decode JPEG on a Mega (SRAM 8Kb)
https://github.com/Bodmer/JPEGDecoder
and I used his library on a STM32F103 with 20Kb SRAM.

Anyway maybe an ESP8266 or an ESP32 can do that?

bitbank

It is the same also for small GIF?
Because Bodmer was able to decode JPEG on a Mega (SRAM 8Kb)
https://github.com/Bodmer/JPEGDecoder
and I used his library on a STM32F103 with 20Kb SRAM.

Anyway maybe an ESP8266 or an ESP32 can do that?
JPEG and GIF compression have nothing to do with each other. Yes, it's possible to decode a JPEG with less RAM than a GIF. The problem with GIF decoding is that the dictionary grows as you decode the image. You may be able to decode a tiny image, but then a slightly larger one will need more room to decode. It would be a "half-baked" solution that would fail frequently. An ESP32 could certainly handle GIF decoding. This topic is about animating images on much more constrained MCUs like the AVR series.
Library? We don't need no stinkin' library...we write our own

dm3942

#25
Nov 25, 2018, 01:33 am Last Edit: Nov 25, 2018, 01:40 am by dm3942
....
I have attached an image of a Star Wars AT-AT that someone might animate:
.....





Done.

zoomx

Thanks. It seems that frame 14 (img14) was lost.

david_prentice

#27
Dec 01, 2018, 01:23 am Last Edit: Dec 01, 2018, 10:10 am by david_prentice
@dm3942,

There are three types of monochrome bitmap:
1.   MSB first.   8-bits across a row per byte.    Used by Adafruit drawBitmap()
2.   LSB first.   8-bits across a row.   Used by Adafruit drawXBitmap() and U8g2lib
3.   KS0108 style.   8 vertical bits per byte.   Draw an 8-bit deep stripe across the screen.   Called a page.

Method (3) is native to the SSD1306,  KS0108, ... controller.   And is the format used by Adafruit and U8g2lib for RAM buffers.

I found Image2GLCD on the Internet.    It appears to be capable of generating all three styles.
I could not get it to work properly.    The program is Chinese.    I don't know how to register in Chinese.   I can't read Chinese Help files.

Image2GLCD can resize to fit your GLCD / OLED
Image2GLCD can alter colour depth / contrast.

Your bitmaps were made for (2) with default depth.   You could get better images if you adjust the depth.

I suspect that some programs can extract multiple frames from an animated GIF.    Which would be nice.

Anyway,   I have adapted your arrays to suit a Uno.
And converted them to (3) format.

A Uno can achieve about 15 FPS with I2C and drawBitmap() or 30FPS with the native KS0108 format.

If you use SPI,   you can get 30FPS and 285 FPS on a Uno.

Can anyone recommend an Image program that work properly?
It would be nice to generate multiple C arrays  directly from animated GIF.

David.

zoomx

I found Image2GLCD here
http://www.ablab.in/image2glcd-software/
it is in english not chinese!
I found also this one
https://sourceforge.net/projects/lcd-image-converter/
and this one
http://bitmap2lcd.com/blog/
No one works with animated gif.
I believe that it can be done using multiple  programs, one for splitting gif and one for converting, with a third program that automate the process.

david_prentice

I will wait to hear from someone that has a positive experience with a PC app.

I do not want to "register" with an Indian website.
I do not mind paying a modest contribution to the real author.

David.

Go Up