fish2000 / colorpy Goto Github PK
View Code? Open in Web Editor NEWMark Kness' ColorPy, now on GitHub.
Home Page: http://markkness.net/colorpy/ColorPy.html
License: Other
Mark Kness' ColorPy, now on GitHub.
Home Page: http://markkness.net/colorpy/ColorPy.html
License: Other
from colorpy import colormodels as cm
class ColorPy(object):
@staticmethod
def irgb2lab(r, g, b):
irgb = cm.irgb_color(r, g, b)
rgb = cm.rgb_from_irgb(irgb)
xyz = cm.xyz_from_rgb(rgb)
lab = cm.lab_from_xyz(xyz)
return lab
@staticmethod
def rgb2lab(r, g, b):
rgb = cm.rgb_color(r, g, b)
xyz = cm.xyz_from_rgb(rgb)
lab = cm.lab_from_xyz(xyz)
return lab
@staticmethod
def rgb2xyz(r, g, b):
rgb = cm.rgb_color(r, g, b)
xyz = cm.xyz_from_rgb(rgb)
return xyz
Try to convert gray rgb_color(.5, .5, .5) should be near ('xyzColorMath', '0.203 0.214 0.233') but is ('xyzColorPy', '0.475 0.500 0.545').
http://www.easyrgb.com/index.php?X=CALC#Result
http://www.workwithcolor.com/
(('rgb', (0.5, 0.5, 0.5), [128.0, 128.0, 128.0]),
('xyzColorPy', '0.475 0.500 0.545'),
('xyzColorMath', '0.203 0.214 0.233'),
('labColorPy', '76.069 0.000 0.000'),
('labColorMath', '53.389 -0.000 -0.005'))
Since you seem to be the owner of the PyPI version of colorpy, can you please upload the latest version? The version currently posted is not python 3 compatible. Thanks in advance!
Please comapre results of CIE lab colorpy:
https://www.dropbox.com/s/icv3uz3xlndg0nm/cielab2.png
with colormath CIE lab:
https://www.dropbox.com/s/4pqglkzbi66p1v5/cielab.png
As I found there is problem with luminance for red - colorpy give higher luminance than the most libraries and it is not explained.
Luv is also strange - i am using color fixes so if not in range it is cut to 255, 0 - it is not the best but should not impact too much d65 used.
colorpy:
https://www.dropbox.com/s/bhy9ckbwrsgtrjp/cieluv2.png
colormath:
https://www.dropbox.com/s/jdgf03su72vwfzo/cieluv.png
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.