I have just finished rewriting Multiavatar Generator in PHP.
Initially coded in JavaScript, this version of Multiavatar is for PHP-based backend environments.
It is now being used for the Multiavatar API (https://api.multiavatar.com), which became much faster, because before it was a mix of PHP and Node.js, and now just PHP.
You can use it by including the Multiavatar.php in your code, or by installing it with Composer.
More info about the Multiavatar algorithm and design is available in the JS repository (https://github.com/multiavatar/Multiavatar) and in the Multiavatar web-app (https://multiavatar.com), which is based on Laravel 8, Vue.js, and ImageMagick PHP extension.
Your feedback is welcome and appreciated!
very cool project … i noticed you called strval()
on $avatarId
two times
in
public function __construct($avatarId, $sansEnv, $ver) {
$this->svgCode = $this->generate(strval($avatarId), $sansEnv, $ver);
}
and in
public function generate($avatarId, $sansEnv, $ver) {
$string = strval($avatarId);
....
Awesome! I will start to use it in my projects!
You’re welcome!
That’s awesome! I am looking to do some image/text manipulation in PHP and your code might be a good learning experience. Thanks!
Multiavatar Generator is manipulating vector images (SVG), which are text-based. For raster (e.g. PNG) image manipulation, you should check the ImageMagick PHP extension. It is used in Multiavatar’s merch maker: First, the vector SVG file is converted to PNG, then edited and overlayed over a JPG photo, and then finally saved as a new image file and returned to the user.
Members
Online