Skip to main content

A library to create icons similar to Github avatars

Project description

py-retricon

Library to create identicons similar to Github avatars.

Port of node-retricon https://github.com/sehrgut/node-retricon to python.

Usage

from retricon import retricon

img = retricon("Hello World!")
img.save('hello.png', 'PNG')

Parameters

style           Predefined style (Default: None)
tile_size       Size of a tile (Default: 1)
tile_color      Tiles color (Default: 0)
tile_padding    Padding of each tiles (Default: 0)
bg_color        Background color (Default: None)
image_padding   Padding of the icon (Default: 0)
tiles           Number of tiles that make the width of the icon (Default: 5)
min_fill        Minimum ratio of tile in the image (Default: 0.3)
max_fill        Maximum ratio of tile in the image (Default: 0.9)
vertical_sym    Use vertical symmetry (Default: True)
horizontal_sym  Use horizontal symmetry (Default: False)
width           Width of the output image in pixels (Default: 500)

Predefined styles

'github'
'gravatar'
'mono'
'mosaic'
'mini'
'window'

Valid color value

None -> transparent
0 -> the lighter color chosen for you from the hash
1 -> the darker color chosen for you from the hash
An array describing the RGB(A) color (e.g. [125, 75, 250])
An hexadecimal representation of the color (e.g. "0fd5e4")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retricon-1.3.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

retricon-1.3.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file retricon-1.3.3.tar.gz.

File metadata

  • Download URL: retricon-1.3.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for retricon-1.3.3.tar.gz
Algorithm Hash digest
SHA256 554bdec59d6222828b9cc8e35abb3934ed0fdd79701dfcbd0c10fe6921db6acb
MD5 d278ade048b23991e934d851b3b893a7
BLAKE2b-256 67aaa98dcb1bcb2d5056f2d71f59ba2cb8a385211d8f3560eb3c0ae65bbd9ab7

See more details on using hashes here.

File details

Details for the file retricon-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: retricon-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for retricon-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d5f456234094bd3a6a358935b9366f7c2741f2341cb138616dc441dcfb38c68
MD5 8467eb751a9aff3288b02271d140f7b0
BLAKE2b-256 91bf0a4c1d8380d707b4f6b0d14cd4ab147ad92f4b53c6bf96aeb0090bcae242

See more details on using hashes here.

Supported by

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