This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Looking good: Basic color management for X

By Nathan Willis on March 15, 2005 (8:00:00 AM)

Share    Print    Comments   

Periodically I hear someone say that Linux isn't suitable for graphic design work. One common complaint is its lack of an integrated system-wide color management system (CMS). Fortunately today's Linux systems have free cross-platform open source color management alternatives.

To those who work primarily with graphic data, having a color-managed system is as important as having CVS is to a programmer: it takes care of a well-understood problem by abstracting the details. You set it up once and let it handle the repetitive-but-important tasks so you can keep your mind on design questions.

The big technical hurdle graphic designers, photographers, and other media people have to overcome is that no two devices in the world register or reproduce color in the same way. Ink, phosphor, fluorescent lamps, the human eye -- all compose colors in different ways, using different primaries, with different results.

And there are different colorspaces -- mathematical models for describing color. Even when you're using an RGB colorspace, the particular wavelengths of red, green, and blue that you define as your primaries restrict which and how many colors your model can describe. An NTSC television signal has one set of red, green, and blue primaries, your computer monitor has another, and an image file might have yet a third.

Consequently, to move an image from one domain to another and ensure it looks the same, you have to profile the characteristics of each domain, then translate the image data from the first profile to the second. In this sense, the "domain" in question may be either an input or output hardware device (i.e., a scanner or a printer) or a file (think about that -- the file serves as both input and output at varying times).

A lingua franca

That's all that a color management system does: translate the image data when it moves from one source to another. This requires a profile of each hardware device and its color characteristics. The profile is simply a numeric table mapping the relationship between the device's image data and the corresponding colors in a standardized, device-independent colorspace called the profile connection space (PCS). The equivalent profile for an image file (instead of a hardware device) describes the file's colorspace in relation to the PCS. The format of this data is defined by the International Color Consortium, so they are frequently called ICC profiles and use the file extension .icc.

Every device and every colorspace has a slightly different gamut, or range of possible colors. To be a useful reference point, the PCS has to encompass all of the possibilities. The standard is the color model defined by the nonprofit CIE -- the International Commission on Illumination -- that encompasses the full gamut of light visible to the human eye. There are two colorspaces that describe this gamut, CIE-XYZ and CIELab. They describe the same gamut, but in different ways -- CIE-XYZ is a traditional RGB model, and CIELab uses a Luminance component (L) and two color-balance components (a and b). But we need not delve into the technical differences; we're letting the CMS worry about that.

So the CMS can translate the {red,green,blue} triples generated by a desktop scanner into the equivalent sRGB data you store in a JPEG or TIFF file, NTSC-compatible colors for use in video, or even the CMYK quadruples needed by a printer -- all by transforming the data through this common denominator.

It's a straightforward enough idea if you just want to match your printouts as closely as possible to what you see on your screen. The CMS maps the data from one space to the other, squeezing or expanding the gamut of colors to make the best perceptual match. This gamut-mapping behavior is referred to as perceptual intent, and is the most common.

But the CMS can be used with other "intents" -- notably colorimetric intents, useful for cases where going out of gamut is seriously bad and you need to know about it. You can use the CMS to make proofs that reproduce the in-gamut colors exactly and clip out-of-gamut colors entirely, which should help grabbing your attention before you send your annual report off to the printers and it comes back looking surprisingly ugly.

Sounds good in theory, right?

So how do mere mortals use color management? Well, Apple's color management system is called ColorSync, Microsoft's is called Image Color Management, and both are fairly integrated into their operating systems. On both of these platforms, however, Adobe software is the standard for image manipulation, and Adobe Photoshop has its own built-in color management subsystem. Fortunately the rest of us have a free software alternative.

On today's Linux systems, the most common CMS is Little CMS, a cross-platform open source project run by Marti Maria. Little CMS implements a library called liblcms, which exposes color-management functions to interested applications. The Little CMS distribution also includes two command-line tools for embedding ICC profiles in TIFF and JPEG images, called tifficc and jpegicc respectively.

Two prominent applications that use Little CMS are Scribus, the WSYIWYG desktop publishing program, and Cinepaint, the free film-retouching offshoot of the GIMP.

In both applications, you must activate color management through a preferences panel. Once you have done so, you select the profiles for your monitor and printer, choose a working profile, and set whether you want to run color management with a perceptual or colorimetric intent. The rest is done automatically. With a color-managed system, you can now build documents with Scribus, incorporating images edited in Cinepaint, and have confidence that what you see (on your properly calibrated monitor, of course) really is what you will get.

Of course, two applications isn't a lot, and you lose all the benefits of color management if you only use it half the time. The big gaping hole in the color-managed Linux workflow at the moment is the GIMP. The current release, 2.2, does not support any form of color management. The developers have indicated that future releases will include color management, but in the meantime you have to work around this omission. The best thing you can do is use Cinepaint instead of the GIMP when you have to match colors. I frequently use Cinepaint for photographic images anyway, since it supports 48-bit color like high-end scanners and digital cameras do.

On the other hand, the current version Cinepaint is several revisions behind the GIMP when it comes to tools and other features -- it has standard photo-retouching capabilities, since that is its purpose, but little else. But there is no reason that you cannot create graphics with the GIMP and then finalize them with Cinepaint, applying the proper ICC profile to the file.

Lose the profiling blues

Of course, making all of this work hinges on having accurate ICC profiles. To get these, you can take several routes. Many printer and scanner manufacturers include ICC profiles for their products on the bundled driver disks -- something useful to the Linux user, for once! These are generally good, although it would not hurt to run some tests and profile your own devices if you want to squeeze the maximum out of your hardware.

Displays are a little bit trickier. There are some excellent Windows and Mac profiling tools (both freeware and commercial), and some people report having success using these tools under WINE. Alternatively, you could generate profiles under another operating system and simply copy the .icc file to your Linux installation. Be forewarned, though, that this is not a perfect solution; each OS may not treat your hardware the same way. In particular, Windows and Mac OS can alter the video look-up table (LUT) for many displays, but X cannot.

There are also freely available ICC profiles. Adobe offers free downloads of some common file profiles including sRGB and AdobeRGB. They also include some generic CMYK profiles, but they are less useful. A CMYK profile is really only useful for professional-level print shop printers. Desktop printers such as the ones most of us have attached to our PCs -- even high-quality photo printers that have 6 or 8 inks -- actually expect data in RGB form. If you're skeptical that this is true, consider how many printer models these days come with the ability to print directly from cameras or memory cards; there is no RGB-to-CMYK conversion step performed.

If you want the highest quality profile that free software can buy, check out Graeme Gill's Argyll utilities. Argyll is a complete color management system like Little CMS, though Little CMS is used by more Linux applications. More importantly, Argyll supplies a full set of utilities to perform monitor, scanner, and printer profiling. That is a complicated task; when you are ready to try it, the online documentation will guide you through the steps. Until then, just know that the tools are there.

Color me distribution-deployed

Right now, color management on Linux and other free operating systems is usable for those people who care about it, and, like font support just a few years ago, it is on the threshold of widespread adoption, lacking only a push from major vendors to really take off. The technical work is done, but it is left to the enterprising user to activate it and take advantage. Hopefully more and more applications are adding support for color management, through Little CMS, Argyll, or some as-yet-undiscovered alternative. Ideally any program that displays or processes image data can and should be ICC-aware. Different applications can depend on different CMS code, and as long as both are well-written and use the same ICC profiles they will coexist peacefully.

Can you work on graphics without using color management? Yes, of course. But you will spend extra hours and extra money on repeated proofing and printing steps.

Share    Print    Comments   

Comments

on Looking good: Basic color management for X

Note: Comments are owned by the poster. We are not responsible for their content.

Gimp Color Manager plugin

Posted by: Anonymous Coward on March 15, 2005 11:49 PM
There is a plugin for the Gimp that will adjust images using ICC color correction profiles. I've been using it with good results on scanned images.

#

Xserver

Posted by: Anonymous Coward on March 16, 2005 12:24 AM
Heya,

I read that the Xserver has cms-capabilities. I think it was on the scribus-site<nobr> <wbr></nobr>... If you enter on the commandline "man -k cms" you get some references<nobr> <wbr></nobr>...

Michel

#

Re:Xserver

Posted by: Anonymous Coward on March 18, 2005 07:47 AM
this come from "man xcmsdb" :

SYNOPSIS

              xcmsdb [ -query ] [ -remove ] [ -format 32|16|8 ] [ filename ]

DESCRIPTION

              xcmsdb is used to load, query, or remove Device Color Characterization

              data stored in properties on the root window of the screen as specified

              in section 7, Device Color Characterization, of the ICCCM. Device

              Color Characterization data (also called the Device Profile) is an

              integral part of Xlib's X Color Management System (Xcms), necessary for

              proper conversion of color specification between device-independent and

              device-dependent forms.

#

CMS structure is pretty much emplaced in The GIMP

Posted by: Leon Brooks on March 16, 2005 07:36 AM
Sven in particular has been <A HREF="http://bugzilla.gnome.org/show_bug.cgi?id=78265" title="gnome.org">busy</a gnome.org>.

#

CMS Printers.

Posted by: Anonymous Coward on March 16, 2005 05:07 PM
"If you're skeptical that this is true, consider how many printer models these days come with the ability to print directly from cameras or memory cards; there is no RGB-to-CMYK conversion step performed."

Quite a few. Epson and HP have some models that'll accept a card, and the coversion is easy to do internally.

#

Re:CMS Printers.

Posted by: Anonymous Coward on March 16, 2005 09:14 PM
Actually, it's not the printer that wants data in RGB form, it's the driver. Printers with card sockets have firmware (really a driver built into the printer) to perform the conversion, but all of the inkjets I'm familiar with do indeed expect input data in CMYK, or whatever particular combination of inks the printer uses.

Drivers can accept data in whatever format they want, and convert it to the ink set used by the printer. Most drivers accept RGB input. Gutenprint (the new name for Gimp-Print) accepts CMY and CMYK input in addition to RGB input.

For most people, using RGB input yields better results. Unless you know the precise characteristics of the printer, or have some other reason to need the more precise control, you're generally better off using RGB and letting the driver do its thing.

-Robert Krawitz, Gutenprint/Gimp-Print project lead

#

Re:CMS Printers.

Posted by: Anonymous Coward on March 16, 2005 10:46 PM
Actually, that is his point. If a printer can print directly from a digital camera or scanner, then (in general at least) it is accepting RGB input rather than CMYK input because that is what digital cameras and scanners produce. In these cases the printer is doing the RGB to CMYK conversion internally (and therefore doing its own profiling).



When he says that no conversion is performed, he means that no conversion is performed by the computer, so conversion profiling on the computer is pointless. Clearly conversion has to be done somewhere in all cases since the image starts out in RGB format while the print must be in CMYK format. Of course it is entirely possible that some printers will accept data in either format.

#

Scribus/LittleCMS works on win32 via Cygwin/X11too

Posted by: Anonymous Coward on March 17, 2005 02:48 AM

Re:Scribus/LittleCMS works on win32 via Cygwin/X11

Posted by: Anonymous Coward on March 17, 2005 02:52 AM
Not sure why the URL for Scribus on win32 got mangled, but here is the same URL via tinyurl: http://tinyurl.com/5qlng

#

Re: LittleCMS

Posted by: kanzels on March 17, 2005 02:46 PM
There is another image editor (Photoshop comparable) using lcms in Linux, it's called Pixel, more info at http://pixel32.box.sk

#

There are no free ICC Profiles? Thats wrong!

Posted by: Anonymous Coward on March 17, 2005 03:12 PM
Much better than the Adobe Profiles, are these from ECI (European Color Initiative) - not only that they give away the best universal RGB profile freely (ECI-RGB v1.0) there are also very good CMYK profiles for offset printing (ECI Offset 2004)!

Look here: <A HREF="http://www.eci.org/eci/en/060_downloads.php" title="eci.org">http://www.eci.org/eci/en/060_downloads.php</a eci.org>

Color Management should be more supported - they also should start a good photo editing programm. Sorry, but GIMP hat the most unusuable UI I've ever seen! (thats not about the toolkit *g*)

They should start to implement the great features of this software in a nice UI + including ICC profiles.

Perhaps a linux box soon with such a program, scribus, and inkscape would be a alternative for me. I am a media designer, and a linux fan<nobr> <wbr></nobr>;o)

#

Get Pixel

Posted by: Anonymous [ip: 91.98.174.66] on November 26, 2007 05:58 AM
i have a problem ,
for Get Pixel with xlib ,without use of GTK Function and QT ,
what do i do???
please help me to solve this problem...

#

icc - generation-gui "LPROF"

Posted by: Anonymous [ip: 129.187.151.193] on January 22, 2008 09:24 AM

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya