identiconpp  0.4.0
identiconpp Documentation

identiconpp is a library to generate identicons for C++ and C.

You get the images as Magick::Image. This allows you to make all kinds of modifications.

The example images above are generated using example.cpp.



The HTML reference can be generated with, if doxygen is installed. It is also available at

You need to generate hashes yourself, any hexadecimal string will do. Make sure to use a safe hashing algorithm for sensitive data (not MD5). You can select as many columns and rows as you like, but make sure you have enough entropy. If something seems to be wrong, exceptions will be thrown.

The "sigil" algorithm generates the same results as sigil and pydenticon.


// Compile with g++ $(Magick++-config --cppflags --ldflags) -lidenticonpp
#include <identiconpp.hpp>
#include <Magick++/Image.h>
int main()
Identiconpp identicon(5, 5, Identiconpp::algorithm::ltr_symmetric,
"ffffff80", { "800000ff" }, { 10, 10 });
Magick::Image img;
img = identicon.generate("55502f40dc8b7c769880b10874abc9d0", 200);

C interface

This is somewhat experimental. Have a look at example.c and identiconpp_c.h.

It seems to be impossible to use Magick++ and MagickWand in the same library, so the images are returned as base64-encoded strings.



Gentoo ebuilds are available via my repository.

Automatically generated packages

Binary packages are generated automatically for each release in the formats:

They are generated on Debian Stretch 64 bit and signed with my automatic signing key.

From source


On a Debian system, install the packages: build-essential cmake libmagick++-dev.


mkdir build
cd build
cmake ..
make install
cmake options

To generate a binary package, execute make package


Contributions are always welcome. You can submit them as pull requests on or via email to tastytea<tt> (ideally using git format-patch or git send-email). Please do not submit them via GitHub, it is just a mirror.



License & Copyright

Copyright © 2018 tastytea <>.
License GPLv3: GNU GPL version 3 <>.
This program comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.



0111 0011 1101 1100 […] 1111 0111 0101 0111
^ ^
| |
pixel matrix foreground color

Implemented in ltr_symmetric.cpp


0111 0011 1101 1100 […] 1111 0111 0101 0111
^ ^
| |
pixel matrix foreground color

Implemented in ltr_asymmetric.cpp


0111 0011 1101 1100
^ ^
| |
foreground color |
pixel matrix

Implemented in sigil.cpp