PHPackages                             mage2pro/color - 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. mage2pro/color

ActiveMagento2-module[Image &amp; Media](/categories/media)

mage2pro/color
==============

A product image color categorization module for Magento 2

1.2.7(1y ago)446[5 issues](https://github.com/mage2pro/color/issues)proprietaryPHP

Since Aug 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mage2pro/color)[ Packagist](https://packagist.org/packages/mage2pro/color)[ Docs](https://mage2.pro/c/extensions/color)[ RSS](/packages/mage2pro-color/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (23)Used By (0)

A product image color categorization module for Magento 2.
The module is **free** and **open source**.
It uses the Google's [Cloud Vision API](https://cloud.google.com/vision) (based on deep learning) to [detect the dominant color](https://cloud.google.com/vision/docs/detecting-properties) of a product's primary image, and then it automatically assigns the proper [color swatch](https://docs.magento.com/m2/ce/user_guide/catalog/swatches.html) to the product.

When a product is saved, the module checks whether the product is a configurable child.
If so, the module checks whether the product's base image was changed. If so, the module analyses the image's colors using Google Cloud Vision API: [![](https://camo.githubusercontent.com/aff046f38646a9cfaea6dd9132e8797a1c331efb41bcc228ebdc3989aa291015/68747470733a2f2f6d616765322e70726f2f75706c6f6164732f64656661756c742f6f726967696e616c2f32582f652f653631623962313633336264656661346539353466636631663438313731623231633831356266612e706e67)](https://camo.githubusercontent.com/aff046f38646a9cfaea6dd9132e8797a1c331efb41bcc228ebdc3989aa291015/68747470733a2f2f6d616765322e70726f2f75706c6f6164732f64656661756c742f6f726967696e616c2f32582f652f653631623962313633336264656661346539353466636631663438313731623231633831356266612e706e67)
Then the module calculates the difference between the primary color and all swatches using the [Delta E (CIE 2000)](http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html) algorithm.
Sometimes the algorithm does not produce the result you want. In this case, you can correct the algorithm by specifying additional swatches for a desired color: [![](https://camo.githubusercontent.com/3639d695be9efece9264ec72747c88385ea7f660d5b27229390939840f8d2220/68747470733a2f2f6d616765322e70726f2f75706c6f6164732f64656661756c742f6f726967696e616c2f32582f332f336231343633633161643735313830623138383438313832383564366333383761333163353131372e706e67)](https://camo.githubusercontent.com/3639d695be9efece9264ec72747c88385ea7f660d5b27229390939840f8d2220/68747470733a2f2f6d616765322e70726f2f75706c6f6164732f64656661756c742f6f726967696e616c2f32582f332f336231343633633161643735313830623138383438313832383564366333383761333163353131372e706e67)
The module uses all samples in a color distance calculation and picks the minimum result as the distance between the swatch and the product image's dominant color. The module has a tesing sandbox. Put test images to the `pub/media/mage2pro` folder, and then go to the `/mage2pro-color` page. The sandbox will show what the module thinks about the images colors: [![](https://camo.githubusercontent.com/915342b0e8b1281a5f76960a40d8fa3d49278e3945bf5dfed41375cbf28e21cb/68747470733a2f2f6d616765322e70726f2f75706c6f6164732f64656661756c742f6f726967696e616c2f32582f352f353437393432623733313734343931626364376238646535366535393735636138643038376533382e706e67)](https://camo.githubusercontent.com/915342b0e8b1281a5f76960a40d8fa3d49278e3945bf5dfed41375cbf28e21cb/68747470733a2f2f6d616765322e70726f2f75706c6f6164732f64656661756c742f6f726967696e616c2f32582f352f353437393432623733313734343931626364376238646535366535393735636138643038376533382e706e67)
Please note that the module uses only color of the `color` Magento product attribute, so to make the module operate more colors, just add more swatches to the `color` attribute.

The module requires [Google Application credentials](https://cloud.google.com/vision/docs/quickstart-client-libraries). Put them to the `app/etc/google-app-credentials.json` file.

How to install
--------------

[](#how-to-install)

[Hire me in Upwork](https://upwork.com/fl/mage2pro), and I will:

- install and configure the module properly on your website
- answer your questions
- solve compatiblity problems with third-party checkout, shipping, marketing modules
- implement new features you need

### 2. Self-installation

[](#2-self-installation)

```
bin/magento maintenance:enable
rm -f composer.lock
composer clear-cache
composer require mage2pro/color:*
bin/magento setup:upgrade
bin/magento cache:enable
rm -rf var/di var/generation generated/code
bin/magento setup:di:compile
rm -rf pub/static/*
bin/magento setup:static-content:deploy -f en_US
bin/magento maintenance:disable

```

How to upgrade
--------------

[](#how-to-upgrade)

```
bin/magento maintenance:enable
composer remove mage2pro/color
rm -f composer.lock
composer clear-cache
composer require mage2pro/color:*
bin/magento setup:upgrade
rm -rf var/di var/generation generated/code
bin/magento setup:di:compile
rm -rf pub/static/*
bin/magento setup:static-content:deploy -f en_US
bin/magento maintenance:disable
bin/magento cache:enable

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

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 ~83 days

Recently: every ~78 days

Total

22

Last Release

704d ago

Major Versions

0.0.3 → 1.0.02019-08-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ff3ceeca28bb312ef9df517484b80307dae5385affdf9ea2e43e73815792a56?d=identicon)[mage2pro](/maintainers/mage2pro)

---

Top Contributors

[![dmitrii-fediuk](https://avatars.githubusercontent.com/u/83204?v=4)](https://github.com/dmitrii-fediuk "dmitrii-fediuk (88 commits)")

---

Tags

google-apigoogle-cloud-visionimage-analysisimage-classificationmage2promage2pro-aimage2pro-modulemage2pro-module-readymage2pro-module-reusablemagentomagento2magento2-extensionmagento2-modulemagentoecommercemagento 2google cloud vision api

### Embed Badge

![Health badge](/badges/mage2pro-color/health.svg)

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

###  Alternatives

[yireo/magento2-next-gen-images

Magento 2 module to add NextGen images support to the Magento frontend

471.1M2](/packages/yireo-magento2-next-gen-images)[mage2pro/currency-format

The «Price Format» extension for Magento 2

215.9k](/packages/mage2pro-currency-format)

PHPackages © 2026

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