Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas Floating Point Color Types #91

Open
ccameron-chromium opened this issue Nov 18, 2022 · 5 comments
Open

Canvas Floating Point Color Types #91

ccameron-chromium opened this issue Nov 18, 2022 · 5 comments
Assignees
Labels
concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) concerns: venue This proposal is in the wrong standards/incubation venue, or it's not in a venue at all from: Google Proposed, edited, or co-edited by Google. topic: graphics Spec relates to 2D or 3D graphics venue: Color on the Web CG Proposal is being discussed in the Color on the Web Community Group hosted at W3C.

Comments

@ccameron-chromium
Copy link

ccameron-chromium commented Nov 18, 2022

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
Copy link
Contributor

annevk commented Nov 18, 2022

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.

@annevk annevk added topic: graphics Spec relates to 2D or 3D graphics concerns: venue This proposal is in the wrong standards/incubation venue, or it's not in a venue at all from: Google Proposed, edited, or co-edited by Google. labels Nov 18, 2022
@ccameron-chromium
Copy link
Author

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.

  • At this point almost all architectures have a hardware instruction for doing conversion to and from float16 (this is F16C aka CVT16 on amd64 CPUs, and from what I can tell ARMv8 has fairly extensive support).
  • Graphics is still using float16, and there just isn't motion towards float32 (perhaps except for some very niche applications).
  • Machine learning has become a huge consumer of float16.
  • Memory is still important, if not more important (we have more pixels than ever), and float16 is half of the memory.
  • Power is still important, if not more important (from mobile to datacenter), and memory is bandwidth is power.

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 othermaciej added venue: Color on the Web CG Proposal is being discussed in the Color on the Web Community Group hosted at W3C. concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) labels Dec 20, 2022
@othermaciej
Copy link

Failure to use Float16Array sounds like concerns: integration.

@ccameron-chromium
Copy link
Author

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
Copy link
Contributor

annevk commented Feb 8, 2023

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

@hober hober changed the title Request for Position: Canvas Floating Point Color Types Canvas Floating Point Color Types Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) concerns: venue This proposal is in the wrong standards/incubation venue, or it's not in a venue at all from: Google Proposed, edited, or co-edited by Google. topic: graphics Spec relates to 2D or 3D graphics venue: Color on the Web CG Proposal is being discussed in the Color on the Web Community Group hosted at W3C.
Projects
Development

No branches or pull requests

4 participants