WebKit / standards-positions

WebKit's positions on emerging web specifications
https://webkit.org/standards-positions/
242 stars 18 forks source link

Canvas Floating Point Color Types #91

Open ccameron-chromium opened 1 year ago

ccameron-chromium commented 1 year ago

Request for position on an emerging web specification

Information about the spec

Design reviews and vendor positions

Anything else we need to know

This allows float16 (MTLPixelFormatRGBA16Float or kCVPixelFormatType_64RGBAHalf) as the backing format of an HTML canvas, in addition to the current 8-bit default. It also adds float32 as an option for ImageData (for the corresponding getImageData and putImageData calls).

annevk commented 1 year ago

Not using Float16Array because it's not in JS feels like "shipping the org-chart". If Float16Array is the right thing to do we should add it to JavaScript.

Also, this really ought to be proposal against the HTML Standard.

ccameron-chromium commented 1 year ago

Not using Float16Array because it's not in JS feels like "shipping the org-chart". If Float16Array is the right thing to do we should add it to JavaScript.

I went back just now and did some digging on this. The main reference is an es-discuss thread that has been going on-and-off from 2014 through 2018. This link picks up the various threads:

I had been under the impression that a decision had been taken against Float16Array. That is not the case. The thinking has been more along the lines of "it's a lot of work and there aren't that many applications beyond OpenGL interop".

The arguments for doing Float16Array have only grown since 2014.

I agree with your assessment. We should add Float16Array now, with/before this proposal (or definitively say we will never do it, if some reason comes up that we aren't seeing).

Also, this really ought to be proposal against the HTML Standard.

Followed up on email about making sure I get the right venue for the discussion.

(Of course, it's all quite sadmaking that this means that what looked like a very simple proposal now has big dependencies and will take longer to get shipping).

othermaciej commented 1 year ago

Failure to use Float16Array sounds like concerns: integration.

ccameron-chromium commented 1 year ago

I have slightly changed my position on the above. I do believe that we should add Float16Array. I believe we should not block Canvas Floating Point Color Types on Float16Array. See the ColorWeb-CG position here.

annevk commented 1 year ago

I outlined my concerns with that proposal in the HTML issue. Thanks for working on opening that!