Current State of Skia Color Management

543 views
Skip to first unread message

Corey Lucier

unread,
Jan 15, 2020, 7:30:07 AM1/15/20
to skia-discuss
Can someone summarize what the current state of color management support is in Skia?

Hypothetically we'd like to support sRGB, Display P3, and continue to support unmanaged rendering (device profile).  Is this all feasible now given the ICC support that was added 2018 or so?

For images tagged with a specific profile at decode time, is this carried forward and honored? 

Any loose ends? Best practices? ... perhaps there is a doc somewhere on the functionality?

Thanks for fielding the open questions.

Mike Klein

unread,
Jan 15, 2020, 8:44:19 AM1/15/20
to skia-discuss
Yep, to turn on color managed drawing, attach an SkColorSpace to the SkSurface or SkBitmap you're drawing into.  All source colors and images will be converted to that space when you draw into that destination.  Untagged source colors or images will be assumed to be sRGB, and if you leave the destination untagged you'll stay in our legacy unmanaged mode.

For simple use cases of sRGB, P3, and unmanaged drawing, you probably won't ever need to touch an ICC profile.  Instead you can just use the constants in SkColorSpace.h to create those color spaces.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/737792c0-2264-4e5f-87fc-57fb7ee793d7%40googlegroups.com.

Corey Lucier

unread,
Jan 15, 2020, 8:57:40 AM1/15/20
to skia-discuss
We did notice one thing so far.

We are probably the only ones using them outside of your test env but for convenience we do use your platform decoders (WIC/CG) which both seem to be blindly tagging all images as sRGB regardless of embedded color profile.  

Any aversion to a patch to make these a little less presumptuous?

Per the stock high gamut equivalent to Mac's Display P3, is that kDCIP3 in SkColorSpace.h?  What does the DCI stand for?

Thanks.



Corey Lucier

unread,
Jan 15, 2020, 9:00:19 AM1/15/20
to skia-discuss
So re. kDCIP3...  

"Display P3 is a color space created by Apple Inc. It uses the DCI P3 primaries but a D65 white point which is much more common among computer-display colorspaces (sRGB and AdobeRGB both use D65). Also unlike DCI-P3's 1/2.6 pure gamma curve, Display-P3 uses the sRGB transfer curve"

So this isn't 100% equivalent to Apple's Display P3 per say?


Mike Klein

unread,
Jan 15, 2020, 9:05:32 AM1/15/20
to skia-discuss
Yeah, I'd absolutely believe that those platform decoders don't do anything with color spaces.  That'd leave them untagged, interpreted as sRGB.  Easiest thing for you to do is probably use SkImage::reinterpretColorSpace() to fix that up with the right color space.

kDCIP3 is misnamed.  It's the D65 P3 used for Display P3.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Corey Lucier

unread,
Jan 15, 2020, 9:13:04 AM1/15/20
to skia-discuss
Thanks.  (FWIW the platform decoders are using SkImageInfo::MakeS32 - so explicitly marked as sRGB).

Mike Klein

unread,
Jan 15, 2020, 9:15:16 AM1/15/20
to skia-discuss
Oh!  How charmingly out of date!  Yeah, send me any improvement you want to make to that code.

On Wed, Jan 15, 2020 at 8:13 AM Corey Lucier <corey....@gmail.com> wrote:
Thanks.  (FWIW the platform decoders are using SkImageInfo::MakeS32 - so explicitly marked as sRGB).

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Mike Reed

unread,
Jan 15, 2020, 9:43:11 AM1/15/20
to skia-d...@googlegroups.com
Good questions about platform-codecs. Leon?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Leon Scroggins

unread,
Jan 15, 2020, 11:37:13 AM1/15/20
to skia-d...@googlegroups.com
I just filed a bug. We'd like to update them, but other issues have taken priority.



--

 •  Leon Scroggins

 •  scr...@google.com


Reply all
Reply to author
Forward
0 new messages