New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 796226 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocked on:
issue 813079

Blocking:
issue 634542



Sign in to add a comment

Transferring wide color gamut encoded images in a mailbox

Project Member Reported by zakerinasab@chromium.org, Dec 19 2017

Issue description

TransferableResource has a gfx::ColorSpace member that allows to
specify the color space of the pixels stored in viz::SharedBitmap.
This can be used to transfer the wcg pixels when the gamut is well defined (sRGB, p3, etc.).

Skia ICC math does not perfectly round-trip. This means that when
a wide color gamut image is encoded using Skia encoders in Blink,
for example by calling toBlob on a P3 canvas, the ICC profile that
defines the gamut of the encoded image will be close to P3, but it
will not be P3. Consequently, we cannot properly create a gfx::ColorSpace
param, and fail to properly propagate color space information.

The only solution that comes to my mind is to replace/augment
gfx::ColorSpace param with a gfx::ICCProfile param in
TransferableResource, assuming that there is a way to convert
arbitrary Skia color spaces to a gfx::ICCProfile.

Adding ccameron@ and brianosman@ to help in this discussion.

 
I think this is all roughly accurate. However, I'm in the process of fixing Skia's Adobe RGB color space, so that it exactly matches what we get from the Adobe ICC profile, and so that it round-trips perfectly:
  https://skia-review.googlesource.com/c/skia/+/84840

I'm interested in giving P3 the same treatment - so that might mitigate some of the problems here.
What if instead of fixing the round-trip, Skia provides a color space comparison method that "considers" the errors that might get introduced during a round-trip?
Cc: hubbe@chromium.org
> The only solution that comes to my mind is to replace/augment
> gfx::ColorSpace param with a gfx::ICCProfile

This has some security issues, since the ICCProfile blob will be then parsed in a different location.

I'm in favor of #1 and also beefing up the gfx::ColorSpace support of ICCProfiles to check for things that are "close enough" as well.
Blockedon: 813079
Project Member

Comment 5 by bugdroid1@chromium.org, May 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3de68da5fcc2b3594795b6afb7699a42e931999e

commit 3de68da5fcc2b3594795b6afb7699a42e931999e
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Thu May 10 19:19:12 2018

Add color management to ImageBitmapRenderingContext

This change adds color management to ImageBitmapRenderingContext.

Bug:  782383 ,  785389 ,  796226 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I653bc2e5d3a32f5211bd09c80ee35b6f4df6ad92
Reviewed-on: https://chromium-review.googlesource.com/973801
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557619}
[add] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/WebKit/LayoutTests/virtual/color_space/fast/canvas/color-space/transferFromImageBitmap.html
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/BUILD.gn
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/offscreen_canvas_resource_provider.cc
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/skia/skia_utils.h
[add] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/skia/skia_utils_test.cc
[modify] https://crrev.com/3de68da5fcc2b3594795b6afb7699a42e931999e/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc

Status: Fixed (was: Assigned)

Sign in to add a comment