Despite 1 letter being different, the entire image is different.
npm install cyber-circle-identicon
import { createIdenticon } from 'cyber-circle-identicon';
import { writeFileSync } from 'fs';
const userIdenticon = createIdenticon('Hello World!');
writeFileSync('identicon.png', userIdenticon);
import { createIdenticon } from 'cyber-circle-identicon'
const ReactComponent = () => {
const userIdenticon = createIdenticon('Hello World!');
return (
<img src={'data:image/png;base64,' + cyberCirclePNG.toString('base64')} />
);
};
Returns a PNG buffer of a cyber circle generated from a string.
key
: string - The key to generate the PNG from. For example, this is someone's username.
additionalOptions
: object - An object of options for greater customization.
size
: number - The size of the image.clipped
: boolean - Whether the image should be clipped to a circle, this should be false if your platform typically clips images to a circle.compression
: number - The compression level of the image, this corresponds with zlib compression.smoothEdges
: number - how much to smooth the edges of each element. This is synonymous to adding anti-aliasing.overrideData
: object - Overrides the default data, this is great for platforms with themes.
Any contribution is greatly appreciated. Feel free to fork the repository and submit a pull request.
I will actively review all issues and pull requests.
Owner
|