Skip to content

Latest commit

 

History

59 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deltae

CI

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:

    pip install deltae

Example Usage:

    import deltae
Takes CIELAB values as a deltae.Lab or a plain dict - example below:
    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:
    deltae.delta_e_1976(Lab1, Lab2)
Get the DeltaE 94 Formula of 2 Lab Values:
    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:
    deltae.delta_e_2000(Lab1, Lab2)

Development

This project uses uv for dependency management and packaging.

    uv sync
    uv run pytest

Releasing

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

About

Calculates the Delta E 2000 or 1976 formula in Python.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages