comforticons
v0.1.0 is out
แพ็คเกจนี้เป็นโมดูลการสร้าง INTEMICON สำหรับรสชาติที่แตกต่างกัน/ไอคอน/gravatar/Avatar
ดู โครงการ Libravatar และ โครงการ Gravatar
โมดูลนี้ได้รับแรงบันดาลใจอย่างมากจากสถาปัตยกรรม/เครื่องกำเนิด ไฟฟ้า PHP ของ Bitverseio และ แพ็คเกจ Pydenticon ของ Azaghal (Gravatar Retro-like Generator)
ลิงค์ไปยังแหล่งที่มา
โมดูลนี้มีอยู่ใน pypi.org
pip install comforticons
รายการ
preprocessorsและgeneratorINTEMICON แบบขับเคลื่อน
python3 -m comforticons
from comforticons import Identicon
# Customize preprocessors and generator settings here
generator = Identicon ()
# This will generate 120x120 with 0 padding PNG identicon
# with transparent background 5x5 pixel identicon (retro gravatar)
# using PixelGenerator and MD5Preprocessor as default
identicon = generator . generate ( "provide data here" )
# Save to file
with open ( "image.png" , "wb" ) as file :
file . write ( identicon ) from comforticons import Identicon
from comforticons . preprocessors . hash import * # *Preprocessor
from comforticons . generators . image import * # PixelGenerator
# Customize preprocessors and generator settings here
generator = Identicon (
# First, process data with md5, then with sha1
preprocessors = [ MD5Preprocessor (), SHA1Preprocessor ],
generator = PixelGenerator (
size = 10 , # 10x10 grid
foreground_colors = [ "#ffffff" ], # Only use white foreground
background = "#000000" , # black, non-transparent background
image_format = "png" , # PNG image format
invert = True , # This will swap bg-fg colors
)
)
# Actually generate identicon
identicon = generator . generate ( "provide data here" )
# Save to file
with open ( "image.png" , "wb" ) as file :
file . write ( identicon )
MD5Preprocessor+PixelGenerator
"identicon"
SHA1Preprocessor+PixelGenerator
"identicon"
ดูใบอนุญาต
ดูใบอนุญาตนี้ด้วย