PHPackages                             tomloprod/radiance - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tomloprod/radiance

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tomloprod/radiance
==================

A deterministic mesh gradient avatar generator for PHP.

v1.0.0(4mo ago)1393.7k↓38%2[1 PRs](https://github.com/tomloprod/radiance/pulls)MITPHPPHP ^8.2.0CI passing

Since Jan 11Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tomloprod/radiance)[ Packagist](https://packagist.org/packages/tomloprod/radiance)[ Fund](https://www.paypal.com/paypalme/tomloprod)[ RSS](/packages/tomloprod-radiance/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

 [![Radiance - Deterministic Avatar Generator](./docs/radiance.png "Radiance - Deterministic Avatar Generator")](./docs/radiance.png)**Beautifully deterministic avatars for PHP**

 [![PHP >= 8.2](https://camo.githubusercontent.com/6cb1ba963623afb0b5b557cc9a2ec3e8833221a9ede88d09e8a6ede86c22b5d4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d25453225383925413520382e322d3737374242343f7374796c653d666c61742d737175617265266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31313138323726636f6c6f723d346635623933266c6162656c3d504850)](https://www.php.net/) [![Version](https://camo.githubusercontent.com/56f249830de9ac94da0c5626939a56d4a64c3e90206bcab3cd5f7d95b0aa6809/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6d6c6f70726f642f72616469616e63653f7374796c653d666c61742d737175617265266c6162656c3d76657273696f6e266c6162656c436f6c6f723d31313138323726636f6c6f723d7768697465)](https://packagist.org/packages/tomloprod/radiance) [![CI](https://camo.githubusercontent.com/3fa9d711245d5005a732ece4a01c6f01f8282bb648c41345ce6b1665f5f4f256/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6d6c6f70726f642f72616469616e63652f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d7465737473266c6162656c436f6c6f723d31313138323726636f6c6f723d316135333464)](https://github.com/tomloprod/radiance/actions) [![Downloads](https://camo.githubusercontent.com/7ebd22acb9d7e6c45159184595566046f6ae6427f4e5c74934d205e9eb95941b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d6c6f70726f642f72616469616e63653f7374796c653d666c61742d737175617265266c6162656c3d646f776e6c6f616473266c6162656c436f6c6f723d31313138323726636f6c6f723d623135333536)](https://packagist.org/packages/tomloprod/radiance) [![License](https://camo.githubusercontent.com/dc5af8ed695e67df62c6cba4f3fc61d132cd734b243f0bfb692673204712d58e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f6d6c6f70726f642f72616469616e63653f7374796c653d666c61742d737175617265266c6162656c3d6c6963656e7365266c6162656c436f6c6f723d31313138323726636f6c6f723d333835343364)](https://packagist.org/packages/tomloprod/radiance)

✨ **About Radiance**
--------------------

[](#-about-radiance)

**Radiance** is a modern PHP library designed to generate beautiful, deterministic mesh gradient avatars from any string. Same input always produces the same unique avatar, making it perfect for user profiles, identicons and more.

     radiance.mp4    👉 [Try the interactive playground](https://radiance.tomloprod.dev/)

📑 **Features**
--------------

[](#-features)

- 🎨 **Deterministic Generation**: Same seed, same avatar. Always.
- 🌈 **Mesh Gradients**: Smooth, vibrant, and perceptually balanced color transitions.
- 📐 **Multiple Shapes**: Circles, Squircles, and Rectangles.
- ⌨️ **Text Overlay**: Add initials or names with automatic font resizing and shadow effects.
- 🧩 **Pixel Patterns**: Optional identicon-style pixel overlays with customizable shapes and colors.
- ⚡ **Fluent API**: An intuitive and expressive interface.

🚀 **Installation**
------------------

[](#-installation)

Requires [PHP 8.2+](https://php.net/releases/).

Install Radiance via [Composer](https://getcomposer.org):

```
composer require tomloprod/radiance
```

---

**✨ Usage**
-----------

[](#-usage)

### Basic Usage

[](#basic-usage)

Generate a simple avatar from a seed:

```
$svg = radiance()
    ->seed('tomloprod')
    ->text('TL')
    ->toSvg();
```

### Advanced Customization

[](#advanced-customization)

Radiance provides a fluent API to fully customize your avatars:

```
$svg = radiance()
    ->seed('tomloprod')
    ->text('TL')
    ->size(256)
    ->squircle()
    ->baseColor('#3498db')
    ->saturation(1.5)
    ->contrast(1.2)
    ->toSvg();
```

### Pixel Patterns

[](#pixel-patterns)

Add a identicon-like pixelated overlay:

```
$svg = radiance()
    ->seed('tomloprod')
    ->enablePixelPattern()
    ->pixelGridSize(8)
    ->pixelOpacity(0.4)
    ->pixelDensity(0.5)
    ->pixelShapeCircles()
    ->pixelColorAccent()
    ->toSvg();
```

### Text Controls

[](#text-controls)

Fine-tune how text is displayed:

```
$svg = radiance()
    ->seed('tomloprod')
    ->text('TL')
    ->fontFamily('Inter')
    ->fontSizeRatio(0.45)
    ->fontSizeRatioAuto(false)
    ->textShadow(0.8)
    ->toSvg();
```

---

**🧱 API Reference**
-------------------

[](#-api-reference)

### Base

[](#base)

MethodDescriptionDefault`seed(string $seed)`Set the deterministic seed.`null` (random)### Shape &amp; Size

[](#shape--size)

MethodDescriptionDefault`size(int $size)`Set the dimension in pixels (width/height).`512``circle()`Set the shape to Circle.-`square()`Set the shape to Square.(Square)`squircle()`Set the shape to Squircle (rounded).-### Colors

[](#colors)

MethodDescriptionDefault`baseColor(string $color)`Influence the generated palette hue. Accepts hex, rgb, or hsl.`null``solidColor(string $color)`Use a fixed background instead of gradient.`null`### Gradient Filters

[](#gradient-filters)

MethodDescriptionDefault`saturation(float $val)`Adjust gradient saturation. 1.0 = original, &gt;1 = vivid, &lt;1 = muted.`1.0``contrast(float $val)`Adjust gradient contrast. 1.0 = original, &gt;1 = higher contrast.`1.0``fadeDistance(int $val)`Control gradient circle size (40-200). Lower = colors more separated.`50`### Text Overlay

[](#text-overlay)

MethodDescriptionDefault`text(string $text)`Add a centered text overlay.`null``fontFamily(string $font)`Set the font-family for the text.`monospace``fontSizeRatio(float $ratio)`Set font size as ratio of avatar size (0.01-1.0). Disables auto-sizing.`0.5``fontSizeRatioAuto(bool $enabled)`Enable/disable automatic font sizing based on text length.`true``textShadow(float $val)`Set text shadow intensity. 0 = no shadow.`1.0`### Pixel Pattern

[](#pixel-pattern)

MethodDescriptionDefault`enablePixelPattern(bool $enable)`Enable/disable the identicon-style overlay.`true``pixelGridSize(int $size)`Set the pixel grid size (3, 5, 7...). Must be odd for symmetry.`13``pixelOpacity(float $opacity)`Set pixel pattern opacity (0.0-1.0).`0.3``pixelDensity(float $density)`Control how many pixels are drawn (0.0-1.0).`0.25``pixelColorGradient()`Use gradient-derived colors for pixels.(Gradient)`pixelColorMonochrome()`Use white color for all pixels.-`pixelColorAccent()`Use complementary accent color for pixels.-`pixelShapeSquares()`Use square shapes for pixels.(Squares)`pixelShapeCircles()`Use circle shapes for pixels.-`pixelShapeMix()`Use mixed shapes (deterministic per seed).-### Output

[](#output)

MethodDescription`toSvg()`Get the avatar as an SVG string.`toBase64()`Get the avatar as a Base64 encoded data URI.---

**🧑‍🤝‍🧑 Contributing**
----------------------

[](#‍‍-contributing)

Contributions are welcome! Please review the [Contributing Guidelines](CONTRIBUTING.md) before submitting a pull request.

1. Fork the project.
2. Create a new branch (`git checkout -b feature/amazing-feature`).
3. Commit your changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature/amazing-feature`).
5. Open a Pull Request.

**📝 License**
-------------

[](#-license)

**Radiance** is open-sourced software licensed under the [MIT license](LICENSE.md).

 Created by **[Tomás López](https://github.com/tomloprod)** • Powered by **[Colority](https://github.com/tomloprod/colority)**

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance77

Regular maintenance activity

Popularity38

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c9df012919bdcf3f17fad0e3a84ec77641f1f9671f85cb9c4377242ba09dde8?d=identicon)[tomloprod](/maintainers/tomloprod)

---

Top Contributors

[![tomloprod](https://avatars.githubusercontent.com/u/7898894?v=4)](https://github.com/tomloprod "tomloprod (1 commits)")

---

Tags

avatar-generatordeterministicfluent-apiidenticonmesh-gradientphppixel-artsvgphpgeneratorsvgavataridenticondeterministicmesh-gradient

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tomloprod-radiance/health.svg)

```
[![Health](https://phpackages.com/badges/tomloprod-radiance/health.svg)](https://phpackages.com/packages/tomloprod-radiance)
```

###  Alternatives

[genericmilk/docudoodle

Generate documentation for your Laravel application using OpenAI

15120.5k](/packages/genericmilk-docudoodle)

PHPackages © 2026

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