Color management on non-Mac platforms

417 views
Skip to first unread message

Adam Barth

unread,
Nov 2, 2010, 6:10:53 AM11/2/10
to Chromium-dev, Peter Kasting, Pascal Massimino
Currently, we only support color management on Mac because we use
CoreGraphics on Mac, which supports color management, but we use Skia
on non-Mac, which does not support color management. I'm finishing up
implementing color profile support in the WebKit image decoders, and I
was wonder if there was interest in using that color profile
information on non-Mac ports. Poking around a bit, there seems to be
an MIT licensed library for doing the color profile transformation:

http://www.littlecms.com/

Implementing color management on non-Mac ports would improve rendering
consistency between Chromium ports and between Chromium and Firefox.

Thoughts?
Adam

Adam Barth

unread,
Nov 2, 2010, 6:18:27 AM11/2/10
to Chromium-dev, Peter Kasting, Pascal Massimino, in...@littlecms.com
[+Marti Maria, author of Little CMS]

Brett Wilson

unread,
Nov 2, 2010, 12:15:26 PM11/2/10
to aba...@chromium.org, Chromium-dev, Peter Kasting, Pascal Massimino
On Tue, Nov 2, 2010 at 3:10 AM, Adam Barth <aba...@chromium.org> wrote:

I think it would be nice to include color management everywhere. The
only reason we haven't done this already is that it's nontrivial and
the only people qualified to work on it have been too busy.

Mozilla replaced lcms with their own which they claim is faster and
better suited to the way a web browser works:
http://muizelaar.blogspot.com/2009/06/qcms-color-management-for-web.html

The code is here:
http://mxr.mozilla.org/mozilla-central/source/gfx/qcms/

I would also prefer to use the same solution as Mozilla's also from a
security perspective. It deals with untrusted content, and going with
the solution actively being shipped in a popular browser seems safer.

Brett

Adam Barth

unread,
Nov 2, 2010, 12:38:45 PM11/2/10
to Brett Wilson, Chromium-dev, Peter Kasting, Pascal Massimino
On Tue, Nov 2, 2010 at 9:15 AM, Brett Wilson <bre...@chromium.org> wrote:
> On Tue, Nov 2, 2010 at 3:10 AM, Adam Barth <aba...@chromium.org> wrote:
>> Currently, we only support color management on Mac because we use
>> CoreGraphics on Mac, which supports color management, but we use Skia
>> on non-Mac, which does not support color management.  I'm finishing up
>> implementing color profile support in the WebKit image decoders, and I
>> was wonder if there was interest in using that color profile
>> information on non-Mac ports.  Poking around a bit, there seems to be
>> an MIT licensed library for doing the color profile transformation:
>>
>> http://www.littlecms.com/
>>
>> Implementing color management on non-Mac ports would improve rendering
>> consistency between Chromium ports and between Chromium and Firefox.
>
> I think it would be nice to include color management everywhere. The
> only reason we haven't done this already is that it's nontrivial and
> the only people qualified to work on it have been too busy.

Do you think it would be beneficial to start with color management
support for images and expand to other areas of the code
incrementally?

> Mozilla replaced lcms with their own which they claim is faster and
> better suited to the way a web browser works:
> http://muizelaar.blogspot.com/2009/06/qcms-color-management-for-web.html
>
> The code is here:
> http://mxr.mozilla.org/mozilla-central/source/gfx/qcms/
>
> I would also prefer to use the same solution as Mozilla's also from a
> security perspective. It deals with untrusted content, and going with
> the solution actively being shipped in a popular browser seems safer.

That sounds like a good idea to me.

Adam

Brett Wilson

unread,
Nov 2, 2010, 12:44:35 PM11/2/10
to Adam Barth, Chromium-dev, Peter Kasting, Pascal Massimino
On Tue, Nov 2, 2010 at 9:38 AM, Adam Barth <aba...@chromium.org> wrote:
> On Tue, Nov 2, 2010 at 9:15 AM, Brett Wilson <bre...@chromium.org> wrote:
>> On Tue, Nov 2, 2010 at 3:10 AM, Adam Barth <aba...@chromium.org> wrote:
>>> Currently, we only support color management on Mac because we use
>>> CoreGraphics on Mac, which supports color management, but we use Skia
>>> on non-Mac, which does not support color management.  I'm finishing up
>>> implementing color profile support in the WebKit image decoders, and I
>>> was wonder if there was interest in using that color profile
>>> information on non-Mac ports.  Poking around a bit, there seems to be
>>> an MIT licensed library for doing the color profile transformation:
>>>
>>> http://www.littlecms.com/
>>>
>>> Implementing color management on non-Mac ports would improve rendering
>>> consistency between Chromium ports and between Chromium and Firefox.
>>
>> I think it would be nice to include color management everywhere. The
>> only reason we haven't done this already is that it's nontrivial and
>> the only people qualified to work on it have been too busy.
>
> Do you think it would be beneficial to start with color management
> support for images and expand to other areas of the code
> incrementally?

If I were doing it I would do it for images and then stop :) I think
this is what Firefox does.

Brett

Adam Barth

unread,
Nov 2, 2010, 12:49:39 PM11/2/10
to bre...@chromium.org, Chromium-dev, Peter Kasting, Pascal Massimino

Ok, that sounds like a tractable problem to me. I'm not sure if I
count as a "qualified" person, but I'll give it a try. Do you know of
a good set of test images? I've been using some images from
Wikipedia, but more test cases is better.

Adam

Scott Byer

unread,
Nov 2, 2010, 1:21:04 PM11/2/10
to aba...@chromium.org, bre...@chromium.org, Chromium-dev, Peter Kasting, Pascal Massimino
I find having good wacky profiles in images is a real help.  I found a good set at http://ie.microsoft.com/testdrive/Graphics/ColorProfiles/, and a good test page at http://www.gballard.net/psd/go_live_page_profile/embeddedJPEGprofiles.html

The other thing you can do is create crazy, wacked out profiles using one of the programs from http://kb2.adobe.com/cps/321/321382.html and use a profile-savvy application like Photoshop to assign them.

Key things to test include behavior of the CMS on subtle gradients, especially greens, behavior in dark areas.  And we'll want to make sure the profiles make their way all the way though to printing.

I agree, no immediate need for color management on non-images for now.

-Scott


--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
   http://groups.google.com/a/chromium.org/group/chromium-dev

Darin Fisher

unread,
Nov 2, 2010, 1:50:06 PM11/2/10
to aba...@chromium.org, Chromium-dev, Peter Kasting, Pascal Massimino
So for Mac Chrome, this means that we are one step closer to being able to
use Skia instead of CG.  Is there a plan to go all the way?  It seems like it
would be nice to unify our ports.

-Darin



On Tue, Nov 2, 2010 at 3:10 AM, Adam Barth <aba...@chromium.org> wrote:

Adam Barth

unread,
Nov 2, 2010, 2:00:17 PM11/2/10
to Darin Fisher, Chromium-dev, Peter Kasting, Pascal Massimino, Nico Weber
I asked Nico about this on IRC. He said the two blocking issues from
his point of view were color management (on the path to resolution)
and something about clipping:

http://neugierig.org/software/chromium/notes/2010/07/clipping.html

IMHO, consistency between Chromium ports is more important than
clipping, but everyone might not agree with that sentiment.

Adam


On Tue, Nov 2, 2010 at 10:50 AM, Darin Fisher <da...@chromium.org> wrote:
> So for Mac Chrome, this means that we are one step closer to being able to
> use Skia instead of CG.  Is there a plan to go all the way?  It seems like
> it would be nice to unify our ports.
>

Darin Fisher

unread,
Nov 2, 2010, 2:02:38 PM11/2/10
to Adam Barth, Chromium-dev, Peter Kasting, Pascal Massimino, Nico Weber
I see.  Yeah, that's an unfortunate rendering issue with our Skia GraphicsContext backend.  I agree with you.

-Darin

Nico Weber

unread,
Nov 2, 2010, 2:07:41 PM11/2/10
to Adam Barth, Darin Fisher, Chromium-dev, Peter Kasting, Pascal Massimino
On Tue, Nov 2, 2010 at 2:00 PM, Adam Barth <aba...@chromium.org> wrote:
> I asked Nico about this on IRC.  He said the two blocking issues from
> his point of view were color management (on the path to resolution)
> and something about clipping:
>
> http://neugierig.org/software/chromium/notes/2010/07/clipping.html

And he added

"3. It would be nice if skia was maintained somehow. If the choice is
between a system library that the OS provider maintains and uses for
all of its apps, and a in-house library without a maintainer with
known bugs that have been open for over a year, the choice doesn't
seem too hard"

or something to that effect :-)

Once these three are addressed, we can _start_ evaluating if it's
worth switching.

Nico

Adam Barth

unread,
Nov 2, 2010, 2:12:43 PM11/2/10
to Nico Weber, Darin Fisher, Chromium-dev, Peter Kasting, Pascal Massimino
On Tue, Nov 2, 2010 at 11:07 AM, Nico Weber <tha...@chromium.org> wrote:
> On Tue, Nov 2, 2010 at 2:00 PM, Adam Barth <aba...@chromium.org> wrote:
>> I asked Nico about this on IRC.  He said the two blocking issues from
>> his point of view were color management (on the path to resolution)
>> and something about clipping:
>>
>> http://neugierig.org/software/chromium/notes/2010/07/clipping.html
>
> And he added
>
> "3. It would be nice if skia was maintained somehow. If the choice is
> between a system library that the OS provider maintains and uses for
> all of its apps, and a in-house library without a maintainer with
> known bugs that have been open for over a year, the choice doesn't
> seem too hard"
>
> or something to that effect :-)
>
> Once these three are addressed, we can _start_ evaluating if it's
> worth switching.

Like the color management and clipping issues, that seems like an
important problem to solve for the (N-1) of N Chromium ports that
don't run on Mac. :)

Adam

Peter Kasting

unread,
Nov 2, 2010, 2:15:16 PM11/2/10
to Adam Barth, Nico Weber, Darin Fisher, Chromium-dev, Pascal Massimino
On Tue, Nov 2, 2010 at 11:12 AM, Adam Barth <aba...@chromium.org> wrote:
> "3. It would be nice if skia was maintained somehow. If the choice is
> between a system library that the OS provider maintains and uses for
> all of its apps, and a in-house library without a maintainer with
> known bugs that have been open for over a year, the choice doesn't
> seem too hard"
>
> or something to that effect :-)

Like the color management and clipping issues, that seems like an
important problem to solve for the (N-1) of N Chromium ports that
don't run on Mac.  :)

They are, but unfortunately the "Skia is not maintained" problem is tricky.  I've also run into showstopper Skia bugs in the past six months, which aren't fixed because we have no one to work on Skia.  senorblanco is the closest thing we have.  I have been told we can contract with Mike Reed to fix issues but I've never gotten further than hearsay there.

PK

Chris Evans

unread,
Nov 2, 2010, 3:59:05 PM11/2/10
to aba...@chromium.org, Brett Wilson, Chromium-dev, Peter Kasting, Pascal Massimino
Yes, please re-use Mozilla's colour management code. I reviewed it and found only one small bug.

I actually wrote a working code execution exploit against Firefox 3.5beta which abused an lcms bug. I believe -- as well as performance -- it's one of the reasons Mozilla switched to their own implementation.

(That said, I'm currently working collaboratively with the lcms author to fix some vulnerabilities in lcms-2.0a. The resulting version should be strong enough to consider if we feel the Mozilla version is lacking in features).


Cheers
Chris
Reply all
Reply to author
Forward
0 new messages