admin管理员组文章数量:1321602
Needed to do some pixel manipulation, but ImageData
has changed. Now it has a colorSpace
property.
What is this, and how do I use it as normal?
Just get an ImageData
object in Chrome to reproduce.
Needed to do some pixel manipulation, but ImageData
has changed. Now it has a colorSpace
property.
What is this, and how do I use it as normal?
Just get an ImageData
object in Chrome to reproduce.
1 Answer
Reset to default 10This es from this proposal to implement color-space management in canvas.
Currently, canvas is stuck with legacy-srgb
8 bit depth. Some monitor can't handle this low level of information.
This is still a proposal, but the currently proposed syntax to set the colorSpace of a 2DContext would be ctx.getContext('2d', {colorSpace: 'color-space', pixelFormat: 'pixelFormat', linearPixelMath: boolean});
Currently, no one has implemented it yet, but chromium and chrome are in the process of doing so.
Their current implementation only exposes a getter colorSpace
property on ImageData objects, and a getContextAttributes
method on the Context2D object, but there is not yet a way to set it for us (maybe there is with some startup flag, but I didn't find it).
Note: You need to set the Experimental canvas features
flag to true in chrome://flags
to get access to these properties.
But anyway, this property should in no way alter your code. All the default parameters of the ImageData are still the same.
本文标签: javascriptWhat is quotcolorspacequot in imagedataStack Overflow
版权声明:本文标题:javascript - What is "colorspace" in imagedata? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742106498a2421041.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论