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

图片马赛克 | idkhts's blog #18

Open
IDKHTS opened this issue Jul 28, 2021 · 0 comments
Open

图片马赛克 | idkhts's blog #18

IDKHTS opened this issue Jul 28, 2021 · 0 comments

Comments

@IDKHTS
Copy link
Owner

IDKHTS commented Jul 28, 2021

https://idkhts.github.io/2021/07/28/%E5%9B%BE%E7%89%87%E9%A9%AC%E8%B5%9B%E5%85%8B/

ImageData对象 canvas的ctx.getImageData(left.top,width,height)可以获取canvas图像内的特定位置宽高的像素信息,这些信息存放在一个ImageData对象里面。 ImageData内就是数组,根据特定公式获取对应位置的像素的R/G/B/Alpha的信息: 例如,要读取图片中位于第50行,第200列的像素的蓝色部份,你会写以下代码: 1blu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant