LWN.net Logo

SCALE 8x: Color management for everyone

SCALE 8x: Color management for everyone

Posted Mar 4, 2010 17:00 UTC (Thu) by rgmoore (✭ supporter ✭, #75)
In reply to: SCALE 8x: Color management for everyone by ssam
Parent article: SCALE 8x: Color management for everyone

i have never understood why applications need to care about colour management, surely it could all be done by the graphics driver.

That works for most applications that are only interested in displaying graphics; they send the color information (possibly with an ICC profile) to the graphics server and don't worry about anything else. But it's obviously not enough for a program that's supposed to be editing the graphics information itself, e.g. GIMP, Inkscape, etc. Those programs need to understand the color information to be able to edit it properly.

A good example of this kind of problem is one that I saw recently about problems with image scaling; most image processing applications do it wrong. The problem is that their color information has a gamma of 2.2, meaning that displayed intensity is supposed to be value**2.2. The correct way to apply scaling is to convert the color information to a linear value, apply the scaling, and then convert back. Instead, most image processing applications use the values with gamma applied, which results in the scaled images being too dark. A properly color aware application wouldn't make that mistake.


(Log in to post comments)

Image scaling problem

Posted Mar 4, 2010 23:04 UTC (Thu) by spitzak (guest, #4593) [Link]

This has little, if anything, to do with "color management".

If as the original poster said, everybody could assume the image is sRGB, then the scaling algorithim could be designed to correctly scale sRGB. This is much easier than something that can scale "anything".

Also from everything I have learned about color management, there appears to be a need for a "blending space" that is controllable and that scaling and mixing is always done linearly in this blending space. If this blending space is sRGB then the scaling is in fact required to do the "wrong" result. You need to change the "blending space" to some linear color space for blending to be correct.

Image scaling problem

Posted Mar 5, 2010 2:02 UTC (Fri) by rgmoore (✭ supporter ✭, #75) [Link]

If as the original poster said, everybody could assume the image is sRGB, then the scaling algorithim could be designed to correctly scale sRGB. This is much easier than something that can scale "anything".
A) I'm not sure that it would be any easier to do everything on the raw sRGB data. It's not just image scaling but all aspects of image processing that are easier to do on linear data. It's likely to be easier to write one algorithm to convert sRGB to linear and one to convert it back than to include an implicit implicit conversion in every image processing algorithm. And if you care about correctness- which you obviously do if you're bothering to worry about the gamma applied data- it's going to be much easier to prove that you're doing everything correctly by working on explicitly gamma corrected data than to count on having the correction in every routine.

B) The "everything is sRGB" assumption is untrue. Real world programs have to deal with all kinds of color spaces. Once you have to deal with more than two color spaces (sRGB and linear), the need for real color management will be much more obvious.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds