Skip to main content

A generator of avatar optimised to generate or random avatars based on multiple image layers

Project description

PiouPiou

logo

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.

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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pioupiou-0.3.0-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page