PHPackages                             vitorbari/image-to-color-palette - 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. vitorbari/image-to-color-palette

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

vitorbari/image-to-color-palette
================================

A PHP class that generates color palettes from images

1.0.2(10y ago)134MITPHPPHP &gt;=5.3.0

Since Aug 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vitorbari/image-to-color-palette)[ Packagist](https://packagist.org/packages/vitorbari/image-to-color-palette)[ RSS](/packages/vitorbari-image-to-color-palette/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (5)Used By (0)

image-to-color-palette
======================

[](#image-to-color-palette)

[![Build Status](https://camo.githubusercontent.com/fb5be6d4266ca16a2fda608d81b1c4b5f732d46cff89903b48e70f94de3e94ce/68747470733a2f2f7472617669732d63692e6f72672f7669746f72626172692f696d6167652d746f2d636f6c6f722d70616c657474652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vitorbari/image-to-color-palette)[![StyleCI](https://camo.githubusercontent.com/c29906e6c7af0ded8cc0beab6e8e45326f60ede4e397b219f896fdcd2fa10062/68747470733a2f2f7374796c6563692e696f2f7265706f732f31313337353836382f736869656c64)](https://styleci.io/repos/11375868)

A PHP class that generates color palettes from images.

Requirements
------------

[](#requirements)

- GD Library

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

[](#installation)

First, pull in the package through Composer.

```
"require": {
    "vitorbari/image-to-color-palette": "~1.0"
}
```

Usage
-----

[](#usage)

```
// Create new ColorPalette object
$palette = new VitorBari\ImageToColorPalette\ColorPalette();

// Set image
$palette->set_image_file('images/myimg.jpg');

// Get colors
$colors = $palette->get_palette();

// Print colors
echo "";
print_r($colors);
```

Examples
--------

[](#examples)

[![Example 1](examples/images/random.jpg?raw=true)](examples/images/random.jpg?raw=true)

Result:

```
Array
(
    [0] => #FF00CC
    [1] => #00FF99
    [2] => #00FF66
    [3] => #00FFCC
    [4] => #99FF00
)

```

[![Example 1 result](examples/images/random-result.png?raw=true)](examples/images/random-result.png?raw=true)

[![Example 2](examples/images/php-med-trans.png?raw=true)](examples/images/php-med-trans.png?raw=true)

Result:

```
Array
(
    [0] => #6666CC
    [1] => #FFFFFF
    [2] => #000000
    [3] => #666699
    [4] => #666666
)

```

[![Example 2 result](examples/images/php-result.png?raw=true)](examples/images/php-result.png?raw=true)

[![Example 3](examples/images/mountains.jpg?raw=true)](examples/images/mountains.jpg?raw=true)

Result:

```
Array
(
    [0] => #0066CC
    [1] => #003366
    [2] => #CCCCCC
    [3] => #336633
    [4] => #006699
)

```

[![Example 3 result](examples/images/mountains-result.png?raw=true)](examples/images/mountains-result.png?raw=true)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

3

Last Release

3922d ago

PHP version history (2 changes)1.0PHP &gt;=5.2.0

1.0.1PHP &gt;=5.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c55c25e56a7889d16c6e53117f94539357a30a5cc1771bffbb9f59a8d28f91b?d=identicon)[vitorbari](/maintainers/vitorbari)

---

Top Contributors

[![vitorbari](https://avatars.githubusercontent.com/u/1184252?v=4)](https://github.com/vitorbari "vitorbari (14 commits)")

---

Tags

color-palettephp

### Embed Badge

![Health badge](/badges/vitorbari-image-to-color-palette/health.svg)

```
[![Health](https://phpackages.com/badges/vitorbari-image-to-color-palette/health.svg)](https://phpackages.com/packages/vitorbari-image-to-color-palette)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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