基于多个图像层优化以生成或随机生成化身的化身的生成器
pioupiou的Python项目详细描述
pioupiou
一种头像生成器,其优化为基于多个图像层生成或随机生成头像,能够从字符串“种子”返回相同的图像。 深受David Revoy的cat avatar generator和MonsterID by Andreas Gohr's的启发。
该发生器依靠枕头库进行图像处理。
Demo(运行这个web site code)https://github.com/buxx/pioupiouweb
安装
来自Pypi
pip install pioupiou
来源
- 克隆此存储库
pip install -e "."
用法
使用它的简单方法,是基于叶绿体。为此,您应该创建许多相同图像的.png文件 有透明度。您应该允许遵循与示例类似的命名模式。
要测试它,只需在示例中使用sample:
猫化身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")
小鸟化身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")
怪物化身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")