Frame Buffer drawing libray with GIF support for Python3
Project description
# 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](https://www.kraxel.org/blog/linux/fbida/).
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
- [x] Upload on PyPi to let it be installable with `pip install`.
- [x] Make installation script
- [x] Proper animtation time delay on every frames
- [x] Standard argument style launcher
- [x] Checking Python version
- [ ] Add more options to program
- [x] Shuffling
- [ ] Picture frame
- [x] Custom clearing
- [ ] Layer support
- [ ] Background loading of next animation file to reduce loading delay between them
- [ ] Optimize with setting screen to RGB mode by sending mailbox message (RGB_to_BGR function will be unused)
- [ ] Bugfix with wrong ioctl command. `dmesg` shows `bcm2708_fb soc:fb: Unknown ioctl 0x5401`
- [ ] Wiki documentation about ioctl and mmap with pure Python.
### Tested on
- Latest Raspbian on Raspberry pi 2 B+
- Archlinux (No, not with the ARM version on RPi, but the one on a vagrant VM)
- Ubuntu Mate Xenial on Odroid C2
### How to install
- prerequisite for pillow (for fresh raspbian)
```
sudo apt install libjpeg8-dev libfreetype6-dev libwebp-dev -y
```
- option1: use pip
```
sudo apt install python3-pip
sudo pip3 install fbpygif
```
- option2: use git and setup.py
```
sudo apt install git
git clone https://github.com/chidea/FBpyGIF
cd FBpyGIF
sudo python3 setup.py install
```
### How to use
These three are identical.
```
sudo FBpyGIF [directory or file list...]
sudo python3 -m FBpyGIF.main [...]
sudo python3 -m FBpyGIF [...]
```
- `FBpyGIF --help` to see all commands.
- Library and script is written for Python >= 3.
- Writing directly to frame buffer driver needs superuser priviledge.
- `FBpyGIF -ct` will put you into color test mode. (Aware of hypnotising screen ;) )
- Utility
- `python3 -m FBpyGIF.util size_cat ~/pictures` will categorize pictures based on its sizes and move into folders horizontal, vertical, square under the directory you run it.
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](https://www.kraxel.org/blog/linux/fbida/).
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
- [x] Upload on PyPi to let it be installable with `pip install`.
- [x] Make installation script
- [x] Proper animtation time delay on every frames
- [x] Standard argument style launcher
- [x] Checking Python version
- [ ] Add more options to program
- [x] Shuffling
- [ ] Picture frame
- [x] Custom clearing
- [ ] Layer support
- [ ] Background loading of next animation file to reduce loading delay between them
- [ ] Optimize with setting screen to RGB mode by sending mailbox message (RGB_to_BGR function will be unused)
- [ ] Bugfix with wrong ioctl command. `dmesg` shows `bcm2708_fb soc:fb: Unknown ioctl 0x5401`
- [ ] Wiki documentation about ioctl and mmap with pure Python.
### Tested on
- Latest Raspbian on Raspberry pi 2 B+
- Archlinux (No, not with the ARM version on RPi, but the one on a vagrant VM)
- Ubuntu Mate Xenial on Odroid C2
### How to install
- prerequisite for pillow (for fresh raspbian)
```
sudo apt install libjpeg8-dev libfreetype6-dev libwebp-dev -y
```
- option1: use pip
```
sudo apt install python3-pip
sudo pip3 install fbpygif
```
- option2: use git and setup.py
```
sudo apt install git
git clone https://github.com/chidea/FBpyGIF
cd FBpyGIF
sudo python3 setup.py install
```
### How to use
These three are identical.
```
sudo FBpyGIF [directory or file list...]
sudo python3 -m FBpyGIF.main [...]
sudo python3 -m FBpyGIF [...]
```
- `FBpyGIF --help` to see all commands.
- Library and script is written for Python >= 3.
- Writing directly to frame buffer driver needs superuser priviledge.
- `FBpyGIF -ct` will put you into color test mode. (Aware of hypnotising screen ;) )
- Utility
- `python3 -m FBpyGIF.util size_cat ~/pictures` will categorize pictures based on its sizes and move into folders horizontal, vertical, square under the directory you run it.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
FBpyGIF-1.0.5.tar.gz
(12.7 kB
view details)
Built Distributions
FBpyGIF-1.0.5-py3.4.egg
(25.8 kB
view details)
FBpyGIF-1.0.5-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file FBpyGIF-1.0.5.tar.gz
.
File metadata
- Download URL: FBpyGIF-1.0.5.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b4822ce0727e457ae8ce73242b82d40d7a72c0922a7bb6b721de6a1550f6320 |
|
MD5 | 7b536621b287a11139a63285494ffbfa |
|
BLAKE2b-256 | b6bb2d735e37f828d2548650f6b9b5b5b9b5d07735a2971995941879aac2cd61 |
File details
Details for the file FBpyGIF-1.0.5-py3.4.egg
.
File metadata
- Download URL: FBpyGIF-1.0.5-py3.4.egg
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e06a4f72e7ba9ba6f55b471676fbad3b7fff3685d7928712d0ba2b04b804b60 |
|
MD5 | 079aa4a21c0fd7532222bbc35499f5ce |
|
BLAKE2b-256 | 26467cb77a719a652d30e010243d0c6a7e0add9f44d1c00efe16d3ad7718cda8 |
File details
Details for the file FBpyGIF-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: FBpyGIF-1.0.5-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117abc9a97f5316e92e1cf3b1674330a73bd2095cacc55f0c8fe317006f5c700 |
|
MD5 | fa16f1007a7f0240dbeabd2f3d3be8cf |
|
BLAKE2b-256 | 7d8d26eafb98481fd831fcc1df459020129de21b9083f60c95003ef035b7a0c8 |