pyCMS and PIL_usm
NOTE: as of PIL 1.7, PIL_usm and pyCMS functionality is built into the standard distribution of PIL - these stand-alone modules are no longer required or being updated/maintained!
pyCMS is a Python module that provides ICC color management services for imaging in Python
through the Python Imaging Library (PIL). PIL images can be easily converted from one
color space to another using simple pyCMS calls. This is very useful for accurate reproduction of images from different digital sources, color matching input and output devices, accurate on-screen proofing, and is also excellent for doing "normal" color mode conversions like from RGB to CMYK (where PIL doesn't have great performance built in).
PIL_usm is a module for PIL that provides true Gaussian Blurring and Unsharp Mask Sharpening functions to PIL. See the PIL_usm page for details.
pyCMS uses the littleCMS ICC library to perform all ICC functionality. The littleCMS library
is by Marti Maria, and details are available at http://www.littlecms.com.
both pyCMS and the underlying littleCMS library are cross-platform compatible! This means that
you can use it with most platforms that Python and PIL will work on. (I've only built binaries
for Windows so far myself, but I'll gladly post more if you send me a link to yours!).
pyCMS is licensed under the GNU LGPL (Lesser General Public License), making it freely
available in source form to programmers everywhere. Depending on how you use pyCMS,
it is possible to use it with both closed-source programs, as well as open-source programs.
pyCMS is very easy to use (of course it has more advanced capabilities too), here's a simple example of how to convert an image from one color space to another (sRGB to CMYK):
import Image
import pyCMS
im = Image.open("c:\\test.tif")
imConverted = pyCMS.profileToProfile(im, "c:\\sRGB.icm", "c:\\SWOP.icm", outputMode = "CMYK")
imConverted.save("c:\\output.tif")
Although I highly encourage you to release your works under the LGPL or GPL licenses,
the choice is up to you. In either case, please follow the licensing terms provided and
ensure to give credit where credit is due. If you have need of this library under
different licensing terms, please contact us to discuss that possibility.
Downloads
pyCMS License (Lesser General Public License)
pyCMS documentation / API only
Full package (vers. 0.0.2 alpha) including source code, documentation,
sample profiles, test scripts, and pre-compiled binary for Windows (compiled with Python
2.2.1, PIL 1.1.3).
Additional files you may want:
littleCMS source code
Additional ICC Profiles(from Adobe) for use with pyCMS
A great image for color managment / ICC testing (Copyright © 2001, 2002 Bruce Justin Lindbloom. All Rights Reserved)
Please let me know if you use pyCMS, how you like it, any bugs/errors you've found, and what
features or improvements you'd like to see. You can email me at:
kevin@cazabon.com
Version History
0.0.2 alpha
- Released Jan 8, 2003
- DLL code is improved with memory leak fixes, code redundancy reduction, and a couple more functions
- added buildProofTransformFromOpenProfiles() function
- small code cleanups... nothing major
- Known To-Do items for this release: same as 0.0.1alpha except as above
0.0.1 alpha
- (Released Dec. 26, 2002): initial release.
- Not all littleCMS features implemented, but the vast majority have been.
- I need to work with Fred Lundh to implement a method of accessing embedded profiles in JPEG, TIFF, and PNG files upon Image.open().
- Documentation is available (mostly as a printout of the __doc__ strings for each function),
but I need to add more ICC theory and background/usage info for those not CM-savvy... q:]
- Known issues and To-Do List for this version
- getDefaultIntent doesn't seem to work properly... whassup??? I'm getting very large int return values instead of 0-3
- getProfileName and getProfileInfo are a bit shaky... work on these to solidify them!
- Add comments to C++ code to make it clearer for others to read/understand (Python code is fine)!!!
- Verify that PILmode->littleCMStype conversion in findLCMStype is correct for all PIL modes (it probably isn't for the more obscure ones)
- Verify that destructor setup for PyCObject_FromVoidPtrAndDesc in buildTransform, buildTransformFromOpenProfiles, getOpenProfile, and createProfile are correct
- Add support for reading and writing embedded profiles in JPEG and TIFF files
- Add support for creating custom RGB profiles on the fly
- Add support for checking presence of a specific tag in a profile
- Add support for other littleCMS features as required
Please help keep shareware software going... make a small donation for us today!
[an error occurred while processing this directive]