chidea / FBpyGIF

Pure Python implemented Frame Buffer memory mapping library with GIF animation playing support on SBC(Raspberry pi)
MIT License
34 stars 5 forks source link

FBpyGIF

Pure Python implemented Memory-mapped Frame Buffer mainly for GIF animation on Raspberry pi

Description

Problem domain

Recent Raspberry pi and similar single-board computers which needs efficient way to show image usually uses fbi. This pack of C libraries and programs are able to show GIF image properly thorugh direct frame buffer, but in lack of function to play GIF animation files.

Features

So I decided to make almost pure Python implemented library that is utilizing frame buffer and memory mapping. The only a thing about 'pure' with this library is that it uses PIL library that is default installed python libarary on official Raspbian to convert image formats into raw BGR(A) and is also providing ways to use imagemagick as decompressor.

Note

There are many documents online how to mmap frame buffer with C, but none of similar are with Python, which also has mmap library by default. Actually there aren't so many examples about Python mmap library either. Hope this code helps you to understand how to ioctl and mmap not only frame buffers but also general Linux drivers with pure Python.

To-do

Tested on

How to install

How to use

These three are identical.

sudo FBpyGIF [directory or file list...]
sudo python3 -m FBpyGIF.main [...]
sudo python3 -m FBpyGIF [...]