The Jdenticon CLI tool can be used to generate identicons. You can also use it from build scripts etc.
npx jdenticon <value> [-s <size>] [-o <filename>]
|All arguments that are not one of the arguments listed below, are concatenated and used as value. If the value is a hexadecimal string of at least 11 characters it is considered a hash and used as base for the icon. If it contains any other value it is hashed using SHA1.|
|100||Sets the width and height of the generated icon in pixels.|
|png||Format of the generated icon. If not specified, the format is automatically determined from the output path. Supported values are |
|<stdout>||Path to output file. If a path is specified, but |
|transparent||Background color on format |
|0.08||Specifies the padding surrounding the icon in percents in the range 0.0 to 0.5. Additional padding might be inserted by Jdenticon to ensure the icon is aligned to the pixel grid.|
|Output the version number of Jdenticon to stdout.|
|Display help information.|
In this example an icon is generated for the value "user127" with the shortest possible command line. It will create a PNG icon and write it to stdout.
npx jdenticon "user127"
Below is the
--output option used to write the icon to a file. The format is determined from the filename.
--back-color is used to remove the transparent background.
npx jdenticon "user127" --output "user127.svg" --back-color "#fff"