Commit 644b6a6b authored by Raphaël Jakse's avatar Raphaël Jakse

minor edits to the readme

parent 94e46d4b
......@@ -9,13 +9,13 @@
![mypy](https://img.shields.io/badge/mypy-checked-blueviolet)
A generator of avatar optimised to generate or random avatars based on multiple image layers, able to return same image from a string "seed".
An avatar generator optimised for generating random avatars based on multiple image layers, able to return same image from a string "seed".
Heavily inspired by [David Revoy](http://www.peppercarrot.com)'s [cat avatar generator](https://framagit.org/Deevad/cat-avatar-generator/) and [MonsterID by Andreas Gohr's](https://www.splitbrain.org/blog/2007-01/20_monsterid_as_gravatar_fallback).
This generator rely on Pillow library to do image processing.
This generator relies on the Pillow library to do image processing.
[Demo](https://pioupiou.inkey-art.net/) (running this [web site code](https://github.com/buxx/pioupiouweb))https://github.com/buxx/pioupiouweb
See a [Demo](https://pioupiou.inkey-art.net/) (running [pioupiouweb from buxx](https://github.com/buxx/pioupiouweb)).
## Install
......@@ -32,12 +32,10 @@ $ pip install pioupiou
## 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.
The 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 follow a similar naming pattern as in the following example.
To test it, you can simply use sample in example:
Cat avatar [by David Revoy](http://www.peppercarrot.com):
To test it, you can, for instance, use a cat avatar [by David Revoy](http://www.peppercarrot.com):
~~~python
from pioupiou import FolderAvatarTheme
......@@ -46,7 +44,7 @@ avatar = theme.generate_avatar(token="just a random string")
theme.save_on_disk(avatar, path="/tmp/saved_file.png")
~~~
Bird avatar [by David Revoy](http://www.peppercarrot.com):
Or a bird avatar [by David Revoy](http://www.peppercarrot.com):
~~~python
from pioupiou import FolderAvatarTheme
......@@ -58,7 +56,7 @@ 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](https://www.splitbrain.org/blog/2007-01/20_monsterid_as_gravatar_fallback):
Or a Monster avatar [by Andreas Gohr's](https://www.splitbrain.org/blog/2007-01/20_monsterid_as_gravatar_fallback):
~~~python
from pioupiou import FolderAvatarTheme
......@@ -72,9 +70,9 @@ theme.save_on_disk(avatar, path="/tmp/saved_file.png")
## Configure Chooser
To generate avatar, pioupiou provide tools to help us use the algorithm you want.
Default behaviour is to rely on `random.Random()`, but pioupiou is made to support any type of chooser.
To do this you just need to configure chooser in your `AvatarTheme`:
To generate avatars, pioupiou provides tools to help you use the algorithm you want.
The default behaviour is to rely on `random.Random()`, but pioupiou is made to support any type of chooser.
To do this, you just need to configure the chooser with your `AvatarTheme`:
~~~python
from pioupiou import FolderAvatarTheme
......@@ -86,8 +84,8 @@ theme = FolderAvatarTheme(
)
~~~
You can use any hashlib algorithm you want from `hashlib` as chooser, using `pioupiou.chooser.HashLibChooser`.
It will do choice using modulo.
You can use any hashlib algorithm you want from `hashlib`, using `pioupiou.chooser.HashLibChooser`.
It will make choices using a modulo.
~~~python
from pioupiou import FolderAvatarTheme
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment