Skip to content

flavono123/identicon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Identicon

image

A Python library for generating GitHub-like symmetrical 5x5 identicons.

image

Installation

pip install Identicon

Usage

Pass a string to Identicon.render(). It will return the PNG formatted byte stream:

identicon = Identicon.render('Python')
# b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xfa\x00\x00\x00...'

You can write to file:

with open('identicon.png', 'wb') as f:
    f.write(identicon)

or get as PIL.Image:

import io
from PIL import Image

image = Image.open(io.BytesIO(identicon))

About

A Python library for generating Github-like identicons 👾

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages