PHPackages                             wwaz/colorconvert-php - 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. wwaz/colorconvert-php

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

wwaz/colorconvert-php
=====================

Converts CMYK to profiled RGB values and vice versa (ICC profiles, LittleCMS).

v1.3.0(today)09↑2566.7%MITPHPPHP &gt;=8.0CI passing

Since Jul 26Pushed todayCompare

[ Source](https://github.com/WWAZ/colorconvert-php)[ Packagist](https://packagist.org/packages/wwaz/colorconvert-php)[ Docs](https://github.com/WWAZ/colorconvert-php)[ RSS](/packages/wwaz-colorconvert-php/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

colorconvert-php
================

[](#colorconvert-php)

PHP library for **profiled conversion between CMYK and RGB** using **ICC profiles**. Transformation is performed by a native helper (LittleCMS / lcms2); this library invokes it and integrates the WWAZ packages for color models and profiles.

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

[](#requirements)

- PHP **8.0+** (union types in the public API)
- Composer dependencies:
    - [`wwaz/colorprofile-php`](https://github.com/WWAZ/colorprofile-php) – ICC profiles and resolution by name
    - [`wwaz/colormodel-php`](https://github.com/WWAZ/colormodel-php) – `CMYK`, `CMYKInt`, `RGB`, `HEX`, …
- A matching helper binary under `bin/` (see below) or an **override** via the `COLORCONVERT_BINARY` environment variable (path to the `colorconvert` executable).

### Helper binary and system libraries

[](#helper-binary-and-system-libraries)

- **macOS:** The bundled `bin/colorconvert-macos` is typically linked dynamically against Little CMS. A binary committed to the repository may contain a **fixed load path** (e.g. Apple Silicon/Homebrew); for distribution or other machines, **rebuild locally** (see [`bin/info.md`](bin/info.md), `brew install little-cms2`).
- **Linux (x86\_64 / aarch64):** Prebuilt **`bin/colorconvert-linux-*`** files are included in the repository (dynamic linking against **Little CMS 2** / `liblcms2`, built with a Debian Bookworm Docker image). The target system needs **`liblcms2-2`** (e.g. Debian/Ubuntu: `apt-get install liblcms2-2`). To refresh the binaries, see [`bin/build.sh`](bin/build.sh) and [`.github/workflows/linux-binaries.yml`](.github/workflows/linux-binaries.yml).
- For build details, see [`bin/info.md`](bin/info.md).

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

[](#installation)

```
composer require wwaz/colorconvert-php
```

For local development, repositories may be registered in [`composer.json`](composer.json) via VCS (`dev-main`).

Optional: custom path to the binary (e.g. without a bundled file):

```
export COLORCONVERT_BINARY=/usr/local/bin/colorconvert
```

Setting ICC profiles
--------------------

[](#setting-icc-profiles)

```
use wwaz\Colorconvert\Convert;

Convert::setCMYKProfile('CoatedFOGRA39');
Convert::setRGBProfile('sRGB2014');
Convert::setIntent('perceptual'); // optional: perceptual, relative (default), saturation, absolute
```

Available profile names depend on the configuration of `wwaz/colorprofile-php` and the ICC files provided.

Usage
-----

[](#usage)

### CMYK → RGB

[](#cmyk--rgb)

```
use wwaz\Colorconvert\Convert;
use wwaz\Colormodel\Model\CMYKInt;

$rgb = Convert::toRGB(100, 0, 0, 0);
$rgb = Convert::toRGB([100, 0, 0, 0]);
$rgb = Convert::toRGB(new CMYKInt([100, 0, 0, 0]));
```

Return type: `wwaz\Colormodel\Model\RGB`.

### RGB / HEX → CMYK

[](#rgb--hex--cmyk)

```
use wwaz\Colorconvert\Convert;

$cmyk = Convert::toCMYK(255, 0, 0);
$cmyk = Convert::toCMYK([255, 0, 0]);
$cmyk = Convert::toCMYK(new \wwaz\Colormodel\Model\Hex('f00'));
```

Return type: `wwaz\Colormodel\Model\CMYKInt`.

### Errors

[](#errors)

On failed conversion, `wwaz\Colorconvert\Exceptions\ColorconversionException` is thrown.

Technical notes
---------------

[](#technical-notes)

- **Rendering intent:** configurable via `Convert::setIntent()` (`perceptual`, `relative`, `saturation`, `absolute`); default is `relative`.
- **Platform:** Depending on OS/architecture, one of `colorconvert-macos`, `colorconvert-linux-x86_64`, `colorconvert-linux-arm64`, or `colorconvert` is chosen (see [`src/Convert.php`](src/Convert.php)).

Building the binary
-------------------

[](#building-the-binary)

See [`bin/info.md`](bin/info.md), [`bin/build.sh`](bin/build.sh), and [`bin/Dockerfile`](bin/Dockerfile).

Tests
-----

[](#tests)

```
composer test
```

License and third-party content
-------------------------------

[](#license-and-third-party-content)

This documentation is **not** a substitute for individual **legal advice**.

- **PHP/project license:** MIT (`LICENSE`; see also [`composer.json`](composer.json)).
- **Little CMS 2** (LGPL 2.1) and further notes on ICC profiles and Composer packages: [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
- LGPL 2.1 license text (reference copy): [`licenses/lgpl-2.1.txt`](licenses/lgpl-2.1.txt).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Every ~85 days

Total

5

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25566288?v=4)[WWAZ](/maintainers/WWAZ)[@WWAZ](https://github.com/WWAZ)

---

Top Contributors

[![WWAZ](https://avatars.githubusercontent.com/u/25566288?v=4)](https://github.com/WWAZ "WWAZ (12 commits)")

---

Tags

conversioncolorrgbcmykicclittlecmslcms2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wwaz-colorconvert-php/health.svg)

```
[![Health](https://phpackages.com/badges/wwaz-colorconvert-php/health.svg)](https://phpackages.com/packages/wwaz-colorconvert-php)
```

###  Alternatives

[spatie/color

A little library to handle color conversions

38221.2M35](/packages/spatie-color)[ozdemirburak/iris

PHP library for color manipulation and conversion.

1201.9M21](/packages/ozdemirburak-iris)[tecnickcom/tc-lib-color

PHP library to manipulate various color representations

247.9M24](/packages/tecnickcom-tc-lib-color)[ssnepenthe/color-utils

A PHP library for performing SASS-like color manipulations.

631.2M16](/packages/ssnepenthe-color-utils)[fjw/color-compare

A library for converting colors (Hex, RGB, HSL, CIELAB (LAB), DIN-99) and calculating color distances based on DIN-99.

1310.8k](/packages/fjw-color-compare)

PHPackages © 2026

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