- From: Pierre-Anthony Lemieux <pal@sandflow.com>
- Date: Mon, 13 Feb 2023 15:15:41 -0800
- To: "public-colorweb@w3.org" <public-colorweb@w3.org>
- Cc: Chris Needham <chris.needham@bbc.co.uk>, Christopher Cameron <ccameron@google.com>
Good morning/evening, Per our earlier call, below is the proposed response to the WHATWG feedback, which I plan to post by 2023-02-14 COB unless objections are raised. Best, -- Pierre """ Can you confirm that the concern is with selecting Float32Array as the default readback type? If so, we are considering using Uint8ClampedArray as the default readback type instead, opening the door for Float16Array and other types to be offered down the line. We are also happy to support the Float16Array proposal in TC 39. Let us know how to best coordinate the effort/proceed. In the meantime, are there objections to supporting Float32Array as one of the (non-default) readback types, while the Float16Array proposal makes its way through the TC 39 process? """ On Mon, Feb 13, 2023 at 12:28 PM Christopher Cameron <ccameron@google.com> wrote: > > Alternative proposal: Make the default readback format always be Uint8ClampedArray. > > For color space, we had the default readback color space match the canvas' color space. > > The plus side that a naive getImageData-then-putImageData doesn't lose data. > The minus side is that a naive application may assume all ImageDatas are sRGB, and get slightly-incorrect results. > > For the type, I think there's a strong case for Uint8ClampedArray being the universal default. > > The plus side is that a naive getImageData+putImageData doesn't lose data. > The minus side is that a naive application will assume all ImageDatas are Uint8ClampedArray and just crash (or worse) when given data that floating point. > > The guiding principle is "make naive use of non-default canvases work reasonably". To think of it, defaulting to Float16Array is pretty dangerous, and breaks this principle. > > On Wed, Feb 8, 2023 at 10:08 PM Chris Needham <chris.needham@bbc.co.uk> wrote: >> >> Hi Pierre, >> >> > Is there a concrete timeline for Float16Array, which would cause the Color CG to revisit its recommendations? >> >> Can we answer this question rather than ask Anne? > > > In some emails, someone said "maybe a year". So creating a dependency on Float16Array puts this project on ice for a year. And that's only if multiple browsers decide that float16 is worth staffing immediately (very unlikely). > > Of note is that WebGL and WebGPU can create floating point canvases today (well, almost today, for WebGL), and so it will be acceptable to leave this feature out of reach to "simpler" applications that use 2D canvas. > > >> >> Can we progress Float16Array within TC39? It's currently a stage 1 proposal: https://github.com/tc39/proposals/blob/main/stage-1-proposals.md >> >> See https://tc39.es/process-document/ for description of their process stages. >> >> Here's the last discussion in TC39, from 2017: >> >> https://github.com/tc39/notes/blob/HEAD/meetings/2017-05/may-23.md#16ig-float16-on-typedarrays-dataview-mathhfround-for-stage-1 >> >> and discission prior to that: https://esdiscuss.org/topic/float16array >> >> There were open questions, can we help answer them to move the proposal forward? >> >> Thanks, >> >> Chris >> >> -----Original Message----- >> From: Pierre-Anthony Lemieux <pal@sandflow.com> >> Sent: 08 February 2023 18:59 >> To: public-colorweb@w3.org >> Subject: WHATWG comments re: Float16Array + HTML Canvas >> >> Good morning/evening, >> >> FYI. See the comment at [1]. >> >> [1] https://github.com/whatwg/html/issues/8708#issuecomment-1423026968 >> >> I suggest we reply. >> >> Below is a first pass at such a reply: >> >> """ >> - the objective is to achieve bit depth greater than 8 bit in Canvas, which is needed for native HDR imagery, among other things. This is needed today. >> >> - the suggestion to add support today for Float32Array today was with the understanding that support for Float16Array could not be added today because it required a change in JS >> >> Is there a concrete timeline for Float16Array, which would cause the Color CG to revisit its recommendations? >> """ >> >> Please provide feedback by Monday COB. >> >> Best, >> >> -- Pierre >>
Received on Monday, 13 February 2023 23:16:06 UTC