2 ms·
What are some of the best libraries that would generate an avatar in PHP directly? Or in Javascript? I don't want to have to hit any APIs.
by EGreg 3y ago
What are some of the best libraries that would generate an avatar in PHP directly?
Or in Javascript?
I don't want to have to hit any APIs.
- sph 3y agoImageMagick?
- hiccuphippo 3y agoYou could generate svg.
- jaynetics 3y agoIf you want to deterministically generate avatars for your users, you're looking for "identicons". Googling that will yield several libraries for any common language.
- doublerabbit 3y agoPHP is nice with GD or ImageMagick. Make a circle.png Use GD to overlay colour over the radius of the circle Apply facial details Then finally anything extra
- Menu_Overview 3y agoYou'll need a library that can render to some 2D-context that can then be converted to PNG. JS is probably where you should look. You might be able to find a good PHP drawing library but I've never come across that in my work. Lots of image converting libraries out there (usually just a wrapper around ImageMagik), but "drawing images" usually a client-side thing and you'll find more support for it. In JS, you'll draw the image to a `<canvas>` element, which can then be downloaded as a PNG. You could go the SVG route, too, depending on the art style. Canvas is the safer bet.
- Superoutman 3y ago[dead]