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

能获取每个像素的 rgba 值吗? #30

Closed
scarletsky opened this issue Aug 15, 2014 · 4 comments
Closed

能获取每个像素的 rgba 值吗? #30

scarletsky opened this issue Aug 15, 2014 · 4 comments

Comments

@scarletsky
Copy link

No description provided.

@nylen
Copy link

nylen commented Oct 2, 2014

I have the same question.

@yolio2003
Copy link

我也有这个需求。。。跪求~~~

@scarletsky
Copy link
Author

我后来还是用 node-canvas 解决这个需求了。
如果需要在 windows 环境下使用 node-canvas 的话,可以参照下这个PR Automattic/node-canvas#458

@zhangyuanwei
Copy link
Owner

其实可以用RAW格式实现读取RGB。
images里面的RAW格式很简单,开头四个字节是固定的 "RAW\n",然后是4个字节的宽度,4个字节的高度,然后就是像素数据了。
具体可以看Raw.cc的源码。
不过比较悲剧的是,当初写码的时候,把Alpha通道去掉了。所以只能得到RGB数据。。。
囧。。。

@oxUnd oxUnd closed this as completed Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants