GithubHelp home page GithubHelp logo

ciede2000's Introduction

Python CIEDE2000

Python implementation of the CIEDE2000 color difference algorithm

A Python function for calculating how similar two colors are, based on the paper The CIEDE2000 Color-Difference Formula: Implementation Notes, Supplementary Test Data, and Mathematical Observations, by Gaurav Sharma, Wencheng Wu, and Edul N. Dalal.

Usage

from ciede2000 import CIEDE2000

print(CIEDE2000((50, 2.6772, -79.7751), (50, 0.0000, -82.7485)))
print(CIEDE2000((50, 0, 0), (50.0000, -1, 2)))
print(CIEDE2000((50, 2.5, 0), (73, 25, -18)))

In order to use the function, you must first transform the colors into CIE L*a*b* color space. That can be done using OpenCV, for example. Here's how to convert the whole image (and then you can pick colors from it):

import cv2

image = cv2.imread("./some_image.jpeg")
image = np.float32(image)
image *= 1./255
Lab = cv2.cvtColor(image, cv2.COLOR_BGR2Lab)
L, a, b = cv2.split(Lab)

ciede2000's People

Contributors

lovro-i avatar lovro-iliassich avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.