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.
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.
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.
Comment 1 by zakerinasab@chromium.org
, May 7 2018