Metadata-Version: 2.4
Name: deltae
Version: 2.0.0
Summary: Deltae 2000 written in pure python. See README.md for more
Keywords: color difference,colour difference,delta e
Author: Kaine Bruce
Author-email: Kaine Bruce <kaineyb@gmail.com>
License-Expression: MIT
Requires-Python: >=3.10
Project-URL: Homepage, https://pypi.org/project/deltae/
Project-URL: Repository, https://github.com/kaineyb/deltae
Description-Content-Type: text/markdown

# deltae

[![CI](https://github.com/kaineyb/deltae/actions/workflows/ci.yml/badge.svg)](https://github.com/kaineyb/deltae/actions/workflows/ci.yml)

Written in Python. 

Requires Python 3.9 or greater

Currently has DeltaE1976, DeltaE94, DeltaE2000 with the others looking to be implemented in the future.

Based on the whitepaper by Gaurav Sharma, Wencheng Wu and Endul N. Dala from the University of Rochester NY

## User Dependancies:
None

## Dev Dependancies:
Pandas and xlrd for rebuilding the test dataset from CIEDE2000.xls (see tests/build_rochester_data.py)

## Background

Uses the data set provided from: https://hajim.rochester.edu/ece/sites/gsharma/ciede2000/dataNprograms/CIEDE2000.xls to test against. (converted to JSON as tests/data/rochester_data.json - see tests/build_rochester_data.py)

Based on using Bruce Lindblooms (http://www.brucelindbloom.com/) DE2000 calcuation. Then updated with the maths from the Rochester white paper.

It seems as though Rochester uses a different calculation for hPrime, h1Prime, h2Prime and hBarPrime than Bruce. However the whole dataset does return the correct deltae2000 values for both formulas. Perhaps there are some combinations of lab values that would be different.

## Installation

Pip: 

```console
    pip install deltae
```


## Example Usage:
```python
    import deltae
```
##### Takes CIELAB values as a deltae.Lab or a plain dict - example below:
```python
    Lab1 = deltae.Lab(L=50.00, a=2.6772, b=-79.7751)
    Lab2 = {'L': 50.00, 'a': 0.00, 'b': -82.7485}
```

##### Get the DeltaE 1976 Formula of 2 Lab Values:
```python
    deltae.delta_e_1976(Lab1, Lab2)
```
##### Get the DeltaE 94 Formula of 2 Lab Values:
```python
    deltae.delta_e_94(Lab1, Lab2)
```
Lab1 is treated as the reference color and Lab2 as the sample - CIE94 is not
symmetric. Pass `application='textiles'` to use the textiles constants instead
of the default graphic arts ones.
##### Get the DeltaE 2000 Formula of 2 Lab Values:
```python
    deltae.delta_e_2000(Lab1, Lab2)
```

## Development

This project uses [uv](https://docs.astral.sh/uv/) for dependency management and packaging.

```console
    uv sync
    uv run pytest
```

### Releasing

```console
    # bump version in pyproject.toml, then:
    uv build
    uv publish --token <PYPI_TOKEN>
```