A generator of avatar optimised to generate or random avatars based on multiple image layers
Project description
PiouPiou
A generator of avatar optimised to generate or random avatars based on multiple image layers, able to return same image from a string "seed". Heavily inspired by David Revoy's cat avatar generator and MonsterID by Andreas Gohr's.
This generator rely on Pillow library to do image processing.
Demo (running this web site code)https://github.com/buxx/pioupiouweb
Install
From pypi
pip install pioupiou
From source
- clone this repository
pip install -e "."
Usage
Easy way to use it, is to be based on FolderAvatarTheme. To do this, you should create many .png file of same image, all with transparency. You should allow follow similar naming pattern as for sample example.
To test it, you can simply use sample in example:
Cat avatar by David Revoy:
from pioupiou import FolderAvatarTheme
theme = FolderAvatarTheme(folder_path="sample/cat_revoy", layers_name=["body", "fur","eyes","mouth","accessorie"])
avatar = theme.generate_avatar(token="just a random string")
theme.save_on_disk(avatar, path="/tmp/saved_file.png")
Bird avatar by David Revoy:
from pioupiou import FolderAvatarTheme
theme = FolderAvatarTheme(
"sample/bird_revoy",
layers_name=["tail", "hoop", "body", "wing", "eyes", "bec", "accessorie"],
)
avatar = theme.generate_avatar(token="just a random string")
theme.save_on_disk(avatar, path="/tmp/saved_file.png")
Monster avatar by Andreas Gohr's:
from pioupiou import FolderAvatarTheme
theme = FolderAvatarTheme(
"sample/monster_id",
layers_name=["legs", "hair", "arms", "body", "eyes", "mouth"],
)
avatar = theme.generate_avatar(token="just a random string")
theme.save_on_disk(avatar, path="/tmp/saved_file.png")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.