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. hracik/php-create-avatar-from-text

ActiveLibrary

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

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

0.1.2(6y ago)0207MITPHPCI failing

Since Jun 16Pushed 6y 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 yesterday

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 37% 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

2522d 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.8k152.1M2.8k](/packages/symfony-form)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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