The Python implementation of the Nyanicons avatar generation library for the Nyano cryptocurrency
nyano.org r/Nyano Discord Twitter + #Nyano
We need help from developers and SVG artists! Please see How can you help? for details. |
---|
For information about Nyano, please see the Nyano README
Similar to Natricons in Nano's Natrium wallet, and MonKeys in the Kalium wallet (for Nano's sister-project Banano), Nyanicons aim to provide a fun artistic touch to Nyano addresses to be displayed in wallaet apps or anywhere the address is shown. Every Nyano address is hashed into a corresponding set of avatar components, which are layered to create a composite avatar image, called a Nyanicon.
The high-level steps taken to generate a Nyanicon avatar given a Nano address are:
- Extract the public key from the Nano address
- Split the public key into N+1 parts, where N is the number of avatar component directories (eg head, collar, eyes, mouth, hat, accessory)
- The +1 is to add a part to determine the avatar's primary color, used to generate the avatar's color scheme
- Generate the avatar's color scheme
- PRIMARY_COLOR: the color determined by the part of the address dedicated as the primary color
- SECONDARY_COLOR: one of two triadic complimentary colors to PRIMARY_COLOR
- TERTIARY_COLOR: the other of two triadic complimentary colors to PRIMARY_COLOR
- MONOCHROME_COLOR: a lighter or darker modification of PRIMARY_COLOR, to be used as an accent
- GRAYSCALE_COLOR: the desaturation of PRIMARY_COLOR, to be used as a neutral color accent
- Cipher (hash) each part value into an index for a single SVG asset file within the corresponding avatar component directory
- Colorize each SVG asset using the generated color scheme
- Layer the colorized SVG assets together into a single composite avatar image
Please understand that while we work to stabilize the Nyanicons library, it will be undergoing rapid changes, including the addition of new SVG assets and changes to the algorithm that generate the composite avatar given a particular Nano address. Therefore, it is extremely likely that the Nyanicon that you see assigned to your particular Nano address will change with a future release. After a stable v1 is released, it will become less likely that avatars will change.
Join the #devs-general channel in the Discord server to chat!
Upon releasing Nyanicons v1, we'll soon be looking for help porting the Nyanicons library to other languages, including Dart, Kotlin, Swift, Javascript, and more. Any help with these ports would be absolutely welcome. We'll link the repositories for the ports as they are created.
Join the #art-general channel in the Discord server to chat!
TODO