PHPackages                             hracik/php-create-avatar-from-text - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. hracik/php-create-avatar-from-text

ActiveLibrary[Image &amp; Media](/categories/media)

hracik/php-create-avatar-from-text
==================================

Create avatar from text. Pseudo-random background, pseudo-random initials.

0.1.2(7y ago)0207MITPHPCI failing

Since Jun 16Pushed 7y agoCompare

[ Source](https://github.com/hracik/php-create-avatar-from-text)[ Packagist](https://packagist.org/packages/hracik/php-create-avatar-from-text)[ RSS](/packages/hracik-php-create-avatar-from-text/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Create avatar from text
=======================

[](#create-avatar-from-text)

Create custom avatar from text

Getting Started
---------------

[](#getting-started)

These instructions will get you a copy of the project up and running

### Installing

[](#installing)

Install with Composer

```
composer require hracik/php-create-avatar-from-text

```

### Usage

[](#usage)

If you want to display text (*text-display* is true by default), but you do not provide both *text-color*, *background-color*, then you should specify option *color-scheme* otherwise text and background will have same color, so text will be invisible.

**Options**:

- size - default *100*
- background-color
- color-scheme - possible values *light*, *dark*
- text-display - default *true*
- text-length - default *2*
- text-case - possible values *upper*, *lower*, *upper-first*, *lower-first*
- text-modification - possible values *initials*, *pseudo*
- text-color
- font-size
- font-weight

```
use Hracik\CreateAvatarFromText;

$options = [
    'size' => 64,
    'text-case' => 'upper',
    'text-modification' => 'initials',
    'font-weight' => 'bold',
    'color-scheme' => 'light',
];
$svg = CreateAvatarFromText::($string, $options);
```

### Examples

[](#examples)

[![](examples/1.svg)](examples/1.svg)[![](examples/2.svg)](examples/2.svg)[![](examples/3.svg)](examples/3.svg)

See [examples](examples).

Running the tests
-----------------

[](#running-the-tests)

Run

```
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests

```

For Windows platforms

```
./vendor/bin/phpunit.bat --bootstrap vendor/autoload.php tests

```

Built With
----------

[](#built-with)

- [PHPUnit](https://phpunit.de/) - The PHP Testing Framework
- [Symfony The OptionsResolver Component](https://symfony.com/doc/current/components/options_resolver.html)

Contributing
------------

[](#contributing)

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/hracik/php-create-avatar-from-text/tags).

Authors
-------

[](#authors)

- **Andrej Lahucky** - *Initial work* - [Hracik](https://github.com/hracik)

See also the list of [contributors](https://github.com/hracik/php-create-avatar-from-text/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

Acknowledgments
---------------

[](#acknowledgments)

- PurpleBooth

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

2570d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acfc4c5459b67a7fa200816b6d3b938cf2efbd3ba942f66b5b1f665275301334?d=identicon)[hracik029](/maintainers/hracik029)

---

Top Contributors

[![hracik](https://avatars.githubusercontent.com/u/46601549?v=4)](https://github.com/hracik "hracik (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hracik-php-create-avatar-from-text/health.svg)

```
[![Health](https://phpackages.com/badges/hracik-php-create-avatar-from-text/health.svg)](https://phpackages.com/packages/hracik-php-create-avatar-from-text)
```

###  Alternatives

[symfony/form

Allows to easily create, process and reuse HTML forms

2.8k158.7M3.3k](/packages/symfony-form)[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k39.4M239](/packages/liip-imagine-bundle)[symfony/rate-limiter

Provides a Token Bucket implementation to rate limit input and output in your application

27051.7M256](/packages/symfony-rate-limiter)[ps/image-optimizer

Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

9141.7M25](/packages/ps-image-optimizer)[symfony/ldap

Provides a LDAP client for PHP on top of PHP's ldap extension

1367.9M56](/packages/symfony-ldap)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M526](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
