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

Issue 839034 link

Starred by 3 users

Issue metadata

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

Blocked on:
issue 874943

Blocking:
issue 634542
issue 874057
issue 713867
issue 874939



Sign in to add a comment

Support 16 bit PNG in ImageDecoder

Project Member Reported by zakerinasab@chromium.org, May 2 2018

Issue description

Since the color managed canvas toBlob/toDataURL supports encoding wide gamut canvas to 16 bit PNG (using SkEncoder), we need to support 16 bit PNG in ImageDecoder. This allows the created blob/dataURL to be drawn to the canvas again.
 
Blocking: 634542
This requires more investigation. We specifically need to test both SkEncoder and ImageDecoder support for 16 bit PNG in the following color spaces:

- legacy (no color space)
- sRGB
- linear RGB
- Display P3 / Rec2020
- linear P3 / Rec2020

Not sure if we need to test ex-sRGB for now.
Cc: zakerinasab@chromium.org
 Issue 839033  has been merged into this issue.
Update:
Based on our recent discussions, we expect convertToBlob() to accept color spaces with regular gamma transfer function, like DiaplyP3. Since, we do not need to decode/encode in linear wide gamut.

AFAICT, we do support 16bit PNGs encoding and decoding. The only catch I have found is that ImageDecoder returns wrong pixel values when 16bit PNG has ProPhotoRGB color profile.
WRONG. We decode 16bit PNG, but decode it to a 8bit SkBitmap, not a F16 one.
Blockedon: 849297
Blockedon: -849297
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 11 2018

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

commit 99c3527b610cb819fc27ce303eb9e08cff3bdd1a
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Mon Jun 11 18:37:28 2018

Support half float backed images in ImageFrame

This is a partial CL toward decoding 16 bit PNG to half float backed
SkBitmap in ImageDecoder.

Bug:  839034 
Change-Id: Ib8824cb7299ccdba8dc393857738b700a7c93388
Reviewed-on: https://chromium-review.googlesource.com/1082968
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566075}
[modify] https://crrev.com/99c3527b610cb819fc27ce303eb9e08cff3bdd1a/third_party/blink/renderer/platform/BUILD.gn
[modify] https://crrev.com/99c3527b610cb819fc27ce303eb9e08cff3bdd1a/third_party/blink/renderer/platform/image-decoders/image_frame.cc
[modify] https://crrev.com/99c3527b610cb819fc27ce303eb9e08cff3bdd1a/third_party/blink/renderer/platform/image-decoders/image_frame.h
[add] https://crrev.com/99c3527b610cb819fc27ce303eb9e08cff3bdd1a/third_party/blink/renderer/platform/image-decoders/image_frame_test.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Jun 29 2018

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

commit 2cb54ea64b0d374bacc4a5be3e10d0c63a16870c
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Fri Jun 29 06:01:36 2018

Plumb ImageDecoder::HighBitDepthDecodingOption

This change does the plumbing for ImageDecoder::HighBitDepthDecodingOption,
which is required to differentiate the expected behavior from PNGImageDecoder.
This is a partial CL toward supporting 16 bit PNG decode to half float backed
bitmap. This CL does not change the behavior and does not contain any tests.
Testing is covered in the main CL:
chromium-review.googlesource.com/c/chromium/src/+/1079788.

Bug:  839034 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie6f34b866b1fbe09bd425bdbecd7fb9726cf9621
Reviewed-on: https://chromium-review.googlesource.com/1113506
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Noel Gordon <noel@chromium.org>
Reviewed-by: Urvang Joshi <urvang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571403}
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/modules/notifications/notification_image_loader.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/exported/web_image.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/graphics/decoding_image_generator.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/graphics/deferred_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/graphics/image_frame_generator.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/graphics/image_frame_generator.h
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/graphics/test/mock_image_decoder.h
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/gif/gif_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/ico/ico_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/image_decoder.h
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/image_decoder_test.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.h
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder_test.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/png_fuzzer.cc
[modify] https://crrev.com/2cb54ea64b0d374bacc4a5be3e10d0c63a16870c/third_party/blink/renderer/platform/testing/image_decode_bench.cc

Cc: -junov@chromium.org
Blocking: 874057
Blocking: 874939
Blockedon: 874943
Project Member

Comment 14 by bugdroid1@chromium.org, Aug 16

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

commit 5724df18b2b500dad017b1dd0ed6f5d07d8d5375
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Thu Aug 16 18:50:39 2018

Decode 16 bit PNG in PNGImageDecoder

This change adds 16 bit decoding to PNGImageDecoder.
This change is a part of the bigger change to support 16 bit PNGs
in the new color managed canvas API
(chromium-review.googlesource.com/c/chromium/src/+/1079788).

BUG:  839034 
Change-Id: I1bf92e1dd4fcbd79ffe7def33223fb5298649eab
Reviewed-on: https://chromium-review.googlesource.com/1148787
Reviewed-by: Leon Scroggins <scroggo@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583760}
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_AdobeRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_AdobeRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_DisplayP3_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_DisplayP3_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_ProPhoto_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_ProPhoto_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_Rec2020_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_Rec2020_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_e-sRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_e-sRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_AdobeRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_AdobeRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_DisplayP3_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_DisplayP3_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_ProPhoto_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_ProPhoto_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_Rec2020_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_Rec2020_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_e-sRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_e-sRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_sRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_interlaced_sRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_sRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_16bit_sRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_AdobeRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_AdobeRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_DisplayP3_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_DisplayP3_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_ProPhoto_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_ProPhoto_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_Rec2020_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_Rec2020_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_e-sRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_e-sRGB_transparent.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_sRGB_opaque.png
[add] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/WebKit/LayoutTests/images/resources/png-16bit/2x2_8bit_sRGB_transparent.png
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/BUILD.gn
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/image_decoder.cc
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/image_decoder.h
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/image_decoder_test.cc
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/image_frame.cc
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/image_frame.h
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/image_frame_test.cc
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.h
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/png/png_image_decoder_test.cc
[modify] https://crrev.com/5724df18b2b500dad017b1dd0ed6f5d07d8d5375/third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc

Status: Fixed (was: Assigned)
Blocking: 713867

Sign in to add a comment