Skip to content

Latest commit

 

History

History
117 lines (96 loc) · 3.57 KB

README.md

File metadata and controls

117 lines (96 loc) · 3.57 KB

CIEDE2000 Color-Difference

This software is not affiliated with the CIE (International Commission on Illumination), has not been validated by it, and is released into the public domain. It is provided "as is" without any warranty.

Languages

The implementation of the CIEDE2000 color difference formula consists of a function having consistent results across various programming languages:

  • JavaScript — TypeScript
  • C — C++
  • PHP
  • Java — Kotlin
  • Python
  • Rust
  • Ruby

Cross-Language Consistency

The functions provided in this repository have been rigorously tested to ensure accurate color evaluation shared across supported languages, with a tolerance of 1e-10.

Testing and Validation

Extensive testing has been conducted to verify the correctness and consistency of the implementations across programming languages:

  • Test Cases: A set of test cases is used to validate the implementations.
  • Tolerance: The results are validated to be within a tolerance of 1e-10.
  • Cross-Language: All supported programming languages ​​are tested, ensuring that results are consistent regardless of the language used.

Usage

Use the CIEDE2000 color difference formula in your programming language.

JavaScript

// Example usage in JavaScript
const deltaE = ciede2000(l1, a1, b1, l2, a2, b2);
console.log(deltaE);

C/C++

// Example usage in C
double deltaE = ciede_2000(l1, a1, b1, l2, a2, b2);
printf("%f\n", deltaE);

Python

# Example usage in Python
delta_e = ciede_2000(l1, a1, b1, l2, a2, b2)
print(delta_e)

PHP

// Example usage in PHP
$deltaE = ciede2000($l1, $a1, $b1, $l2, $a2, $b2);
echo $deltaE;

Java

// Example usage in Java
double deltaE = ciede2000(l1, a1, b1, l2, a2, b2);
System.out.println(deltaE);

Kotlin

// Example usage in Kotlin
val deltaE = ciede2000(l1, a1, b1, l2, a2, b2)
println(deltaE)

Ruby

# Example usage in Ruby
delta_e = ciede_2000(l1, a1, b1, l2, a2, b2)
puts delta_e

Contributing

We aim to extend the compatibility of the deltaE-2000 function to additional programming languages to meet the diverse needs of the users.

Planned Languages

  • Go: In Progress

    • Implement the deltaE-2000 function.
    • Write usage documentation.
    • Create unit tests.
  • Swift: Planned

    • Implement the deltaE-2000 function.
    • Write usage documentation.
    • Create unit tests.
  • TypeScript: Planned

    • Implement the deltaE-2000 function.
    • Write usage documentation.
    • Create unit tests.
  • MATLAB: Planned

    • Implement the deltaE-2000 function.
    • Write usage documentation.
    • Create unit tests.
  • R: Planned

    • Implement the deltaE-2000 function.
    • Write usage documentation.
    • Create unit tests.

How to Contribute

  1. Choose a language: Choose a language that interests you.
  2. Implement the function: Develop the deltaE-2000 function in the language, based on the implementations.
  3. Write documentation: Add a section in the README.md file for the new language, including an example.
  4. Create tests: Write the same test routines as all languages, to ensure the consistency of results.
  5. Submit a pull request: Once your implementation is complete, submit a pull request for review.

Live Example

You can see a live example of the CIEDE2000 color difference calculation at the following link:

License

This project is released into the public domain.