Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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

Project description

PiouPiou

logo

pipeline_build_status

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.

Files for pioupiou, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size pioupiou-0.4.0-py3-none-any.whl (112.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page