Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

python-colormath Released

3 views
Skip to first unread message

Greg Taylor

unread,
Jun 22, 2009, 12:34:27 PM6/22/09
to
Greetings,

After much testing and refinement in an industrial setting, python-
colormath has been released to the public under the GPLv3.

What is python-colormath?
====================
python-colormath is a developer-oriented module that abstracts a
number of color math operations behind a small set of classes
representing color spaces (IE: RGB, CIE Lab, XYZ, and LCH, etc.).
Color conversions, delta E comparisons, and density calculations are
all relatively involved, but are hid behind the simple API. For
example, conversions from RGB to CMY and CMYK are trivial, while
conversions from Spectral to LCHab are equally so (even though much
more math happens behind the scenes).

Quantitative comparisons of the difference between two colors may be
calculated using one of several delta E formulas. Colors are
automatically converted to the appropriate comparison color space and
the delta E formula returns the result with no real effort on your
part.

For those working with spectral power distributions, the module can
convert them to color spaces or ANSI/ISO density values. This is
particularly useful when trying to minimize the difference in the
readings of two different spectrophotometric devices.

It is perhaps best to consider python-colormath as a more advanced,
complete version of Python's own colorsys module. The number of
supported color spaces, operations, and capabilities far exceeds
colorsys (which is simple and minimalistic by design).

Avoid color calculation errors
=====================
One of the biggest benefits of this module is that it was designed and
implemented by members of the Graphic Communications and print
industries. The developers having a formal background in color science
leaves you with a very complete, "correct" implementation of color
math. Unlike the other color libraries, python-colormath avoids many
of the problems with varying types of RGB, color illuminants and
observer angles, and many different things that go on behind the
scenes.

python-colormath is also rigorously tested through its use in a
previously commercial color management system. Additionally, all
conversions are unit tested and monitored for deviations wich each
change to the codebase. This ensures consistent, repeatable results
through each release.

Where is python-colormath?
=====================
Getting Started/Website/Development:
http://code.google.com/p/python-colormath/

Documentation:
http://code.google.com/p/python-colormath/w/list

Download:
http://pypi.python.org/pypi/colormath/

Support:
sup...@l11solutions.com

I hope this fairly niche module is useful to someone else out there!
--
Gregory Taylor

Gernot Hoffmann

unread,
Jun 23, 2009, 1:24:09 PM6/23/09
to

Greg Taylor schrieb:

Greg,

'for example, conversions from RGB to CMY and CMYK are trivial'

IMO, nobody who is familiar with offset printing would consider
RGB to CMYK transformations as something trivial.
I didn't find anywhere in your docs references to ICC-Profiles.

Best regards --Gernot Hoffmann

Greg Taylor

unread,
Jul 17, 2009, 11:40:11 AM7/17/09
to
Gernot Hoffmann wrote:
> IMO, nobody who is familiar with offset printing would consider
> RGB to CMYK transformations as something trivial.
> I didn't find anywhere in your docs references to ICC-Profiles.
>
> Best regards --Gernot Hoffmann

RGB to CMYK transformations are just that, mathematically transforming
RGB to CMYK without regards to profiles. This is not at all useful for
displaying things from your application, but it is useful for
scientific computing (which is what I largely use this library for).
It is also somewhat useful for rough calculations on web-based
applications.

In the context of offset (or printing in general), profiles are, as
you know, device dependent, and are left as an exercise to the users
of the library for now (there are plans to incorporate ICC profiles
later on). You may find a simplified RGB to CMYK formula at:

http://www.easyrgb.com/index.php?X=MATH

I hope that clears up any confusion,
Greg

0 new messages