PHPackages                             jinas/dhivatar - 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. jinas/dhivatar

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

jinas/dhivatar
==============

Dhivehi Avatars PHP port.

v1.2(5y ago)52611MITPHP

Since Oct 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/baraveli/dhivatar)[ Packagist](https://packagist.org/packages/jinas/dhivatar)[ RSS](/packages/jinas-dhivatar/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (1)Versions (7)Used By (1)

dhivatar
========

[](#dhivatar)

[![StyleCI](https://camo.githubusercontent.com/3fd08ca6fb16ac525dde734fccebe78e776fdfb31b51fd63d7a2c7f5512aacd0/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3330333438353631312f736869656c643f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/3fd08ca6fb16ac525dde734fccebe78e776fdfb31b51fd63d7a2c7f5512aacd0/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3330333438353631312f736869656c643f6272616e63683d6d6173746572)

PHP port of phoenixatom Dhivatar package

Installation
------------

[](#installation)

```
composer require jinas/dhivatar

```

Usage
-----

[](#usage)

```
use Jinas\Dhivatar\DhivatarFactory;

(string) DhivatarFactory::create()
    ->setText('ޖިނާސް')
    ->build()
  	->encode('data-url');
```

This will output a base64 encoded of the image

OUTPUT:

[![default](examples/default.jpg)](examples/default.jpg)

```
use Jinas\Dhivatar\DhivatarFactory;

DhivatarFactory::create()
            ->setText("ޖިނާސް", "#C93839")
            ->setFontSize(255)
            ->setBackground("#3083AD")
            ->build()
            ->save('file', 80, 'jpg');  // save the image in 80% quality and  jpg format defined by third parameter
```

OUTPUT:

[![default](examples/file.jpg)](examples/file.jpg)

You can chain setters to customize the generated image.

If you don't set a background image. It will automatically generate a random background color.

Available Methods
-----------------

[](#available-methods)

- setBackground(string $background) : Set the background of the image
- setSize(int $width, int $height) : Set the size of the image canvas
- setText(string $text, string $color) : Set the text and text color
- setFontSize(int $size) : Set the font size
- build() : This method will return an instance of `Intervention\Image\Image` after building the image. Any methods available by [Image Intervention](http://image.intervention.io/) you can call to render,ouput or save the image.

Project by [Jinas](https://github.com/boring-dragon).

Inspired by [phoenixatom dhivehi-avatar](https://github.com/phoenixatom/dhivehi-avatar)

### Looking for an API that does this?

[](#looking-for-an-api-that-does-this)

Head over to [Dhivatar API](https://dhivatars.baivaru.net/). A project by [Baivaru](https://github.com/baivaru)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

4

Last Release

2090d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/jinas-dhivatar/health.svg)

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

###  Alternatives

[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.8M39](/packages/laravolt-avatar)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19346.6k3](/packages/symfony-ux-cropperjs)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37549.4k](/packages/beyondcode-laravel-favicon)

PHPackages © 2026

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