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

Issue 665919 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature


Sign in to add a comment

Implement color management for ImageBitmap in Canvas

Project Member Reported by zakerinasab@chromium.org, Nov 16 2016

Issue description

Implement color management for ImageBitmap in Canvas

Implement color management for ImageBitmap as described in proposal:
(github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md)

ImageBitmap objects are augmented to have an internal color space
attribute of type CanvasColorSpace. The colorSpaceConversion creation
attribute also accepts enum values that correspond to CanvasColorSpace
values. Specifying a CanvasColorSpace value results in a conversion of
the image to the specified color space.


 
Oops, I just wrote up  issue 667420  about some issues involving ImageBitmap because of issues we'll have with pre-converting tile content (see  issue 667411 ).
Blockedon: 670703
Blocking: 634542
Blockedon: 668546 668547
Blockedon: 670715
Blocking: 667431
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 13 2016

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

commit 0f76e01dbfc50d33d6bffb930487ff494babd695
Author: zakerinasab <zakerinasab@chromium.org>
Date: Tue Dec 13 20:10:38 2016

Implement color management for ImageBitamp in Canvas

Implement color management for ImageBitmap as described in proposal:
(github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md)

ImageBitmap objects are augmented to have an internal color space
attribute of type CanvasColorSpace. The colorSpaceConversion creation
attribute also accepts enum values that correspond to CanvasColorSpace
values. Specifying a CanvasColorSpace value results in a conversion of
the image to the specified color space.

This CL only covers the constructor that uses an HTMLImageElement object.

BUG= 665919 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2522693002
Cr-Commit-Position: refs/heads/master@{#438272}

[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/public/common/common_param_traits_macros.h
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/public/common/content_switches.cc
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/public/common/content_switches.h
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/public/common/web_preferences.h
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/content/renderer/render_view_impl.cc
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/Source/core/frame/ImageBitmap.h
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/Source/core/imagebitmap/ImageBitmapOptions.idl
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
[modify] https://crrev.com/0f76e01dbfc50d33d6bffb930487ff494babd695/third_party/WebKit/public/web/WebRuntimeFeatures.h

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 20 2016

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

commit 0165593b23888e943820fe8e96bb6001897d159b
Author: zakerinasab <zakerinasab@chromium.org>
Date: Tue Dec 20 04:30:47 2016

Add unit test for color managed ImageBitamp(ImageBitmap) constructor

This CL is the follow up for CL 2522693002, part of color management implementation
for ImageBitmap as described in proposal:
(github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md)

BUG= 665919 

Review-Url: https://codereview.chromium.org/2575693005
Cr-Commit-Position: refs/heads/master@{#439706}

[modify] https://crrev.com/0165593b23888e943820fe8e96bb6001897d159b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 21 2016

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

commit 31b964e99561272c4a6ffa53a12ef6caa83412b6
Author: zakerinasab <zakerinasab@chromium.org>
Date: Wed Dec 21 20:00:59 2016

Add unit test for color managed ImageBitamp::create(StaticBitmapImage)

This CL is the follow up for CL 2522693002, part of color management implementation
for ImageBitmap as described in proposal:
(github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md)

BUG= 665919 

Review-Url: https://codereview.chromium.org/2596833002
Cr-Commit-Position: refs/heads/master@{#440191}

[modify] https://crrev.com/31b964e99561272c4a6ffa53a12ef6caa83412b6/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 21 2016

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

commit f9801783df3fe00bf8e78e26bc4ed898f9df2281
Author: zakerinasab <zakerinasab@chromium.org>
Date: Wed Dec 21 20:57:20 2016

Add unit test for color managed ImageBitamp(HTMLCanvasElement) constructor

This CL is a follow up for CL 2522693002, part of color management implementation
for ImageBitmap as described in proposal:
(github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md)

BUG= 665919 

Review-Url: https://codereview.chromium.org/2590273005
Cr-Commit-Position: refs/heads/master@{#440207}

[modify] https://crrev.com/f9801783df3fe00bf8e78e26bc4ed898f9df2281/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Comment 11 by junov@chromium.org, Jan 19 2017

Components: -Internals>GPU>Canvas2D
Project Member

Comment 12 by bugdroid1@chromium.org, Jan 23 2017

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

commit f5600ef4dc75558dd888842e742df522550fefc5
Author: zakerinasab <zakerinasab@chromium.org>
Date: Mon Jan 23 20:09:08 2017

Fix ImageBitmap constructor from ImageData to consider the color space tags

This CL fixes ImageBitmap constructor from ImageData such that the constructor
respects the color space tags of both ImageData and target ImageBitmap (as passed
in ImageBitmapOptions parameter).
This is a follow up for CL 2522693002, part of color management implementation
for ImageBitmap as described in proposal:
(github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md).

BUG= 665919 

Review-Url: https://codereview.chromium.org/2630563003
Cr-Commit-Position: refs/heads/master@{#445453}

[modify] https://crrev.com/f5600ef4dc75558dd888842e742df522550fefc5/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/f5600ef4dc75558dd888842e742df522550fefc5/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
[modify] https://crrev.com/f5600ef4dc75558dd888842e742df522550fefc5/third_party/WebKit/Source/core/html/ImageData.cpp
[modify] https://crrev.com/f5600ef4dc75558dd888842e742df522550fefc5/third_party/WebKit/Source/core/html/ImageData.h
[modify] https://crrev.com/f5600ef4dc75558dd888842e742df522550fefc5/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Labels: -Type-Bug Type-Feature
Blocking: 674593
In Blink, the type for ImageBitmapOptions#colorSpaceConversion is ImageBitmapColorSpaceConversion, but in the spec (https://html.spec.whatwg.org/#imagebitmapoptions) the type is ColorSpaceConversion.

Should we standardize ImageBitmapColorSpaceConversion or replace it by ColorSpaceConversion to match the spec?
@#14: Good catch.  We should just match the spec IMHO.
Blockedon: 707898
Blocking: -674593
 crbug.com/707898  filed to address the inconsistency mentioned in #14.
Blockedon: 714266
Blockedon: 714349
Blockedon: 714364
Blockedon: 714649
Project Member

Comment 23 by bugdroid1@chromium.org, Jun 13 2017

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

commit 70d96a8266f71bb56e1cbbc54689b59d8eab5d40
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Tue Jun 13 19:14:11 2017

Refactor ImageBitmap

This CL refactors ImageBitmap. It was essentially started to fix
ImageBitmap constructor from ImageData which was not correctly handling
ColorSpaceConversion attribute passed in ImageBitmapOptions. During the
developement it gradually extended to improving other constructors too.
(This CL is moved from Rietveld codereview.chromium.org/2845193002.)

BUG= 714649 , 683307 ,627855, 715264 , 715239 , 714364 , 686862 , 665919 

Change-Id: Iecba66e8764b189a4f5130096b4b5a19a9a32cae
Reviewed-on: https://chromium-review.googlesource.com/527690
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479093}
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage-expected.txt
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-recursive.html
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/webgl/resources/tex-image-and-sub-image-image-bitmap-utils.js
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/html/ImageData.cpp
[modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/html/ImageData.h

Project Member

Comment 24 by bugdroid1@chromium.org, Jul 18 2017

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

commit 5696a13dd71bbec8c7e86507e4353b4e9af0f8f7
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Tue Jul 18 17:07:42 2017

Refactor ImageBitmap color correction code

This change addresses a couple of issues:
- Simplifies the color correction code path in ImageBitmap
by using the same general code path for all the constructors
(except ImageData which needs a separate code path).
- Adds resize option to the constructor from ImageData.
- Updates ImageBitmap resize layout tests to enlarge the
source (instead of shrinking) such that the correct application
of filter quality can be checked.

Bug: 627855, 665919 , 734587 , 734588 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I73d021a8e07c5a2387111c8daec0122cddb85ebb
Reviewed-on: https://chromium-review.googlesource.com/542959
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487505}
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage-video.html
[add] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/resources/red-green-blue-white-2x2.ogv
[add] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/resources/red-green-semi-transparent-2x2.png
[add] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/resources/tex-image-and-sub-image-image-bitmap-utils-resize-video.js
[add] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/resources/tex-image-and-sub-image-image-bitmap-utils-resize.js
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-blob-resize.html
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-canvas-resize.html
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-image-resize.html
[add] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-imageData-resize.html
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-video-resize.html
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.h
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/Source/core/imagebitmap/ImageBitmapTest.cpp
[modify] https://crrev.com/5696a13dd71bbec8c7e86507e4353b4e9af0f8f7/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Status: Fixed (was: Assigned)
Blockedon: -668547

Sign in to add a comment