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

ActiveLibrary

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 5d 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 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

2039d 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

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[laravolt/avatar

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

2.0k5.4M31](/packages/laravolt-avatar)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[aimeos/aimeos-core

Full-featured e-commerce components for high performance online shops

4.5k346.9k48](/packages/aimeos-aimeos-core)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)

PHPackages © 2026

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