Getting wrong color when drawing large image
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
调研方向
首先使用 nodejs、getPixels() 和 3634x5451 的图像重现报告的 drawImage 内核,并将其与成功的 1000x1000 案例进行比较。检查 setGraphical(true) 的输出和像素读回路径;当大图像以匹配的颜色重新绘制,而不是产生报告中的错误输出时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
First of all , thank you for your great work.
I've been trying to follow wobbling cat example but first I started by redrawing an image. I use nodejs and getPixels() method instead of getting a canvas. It all works fine with cat.jpg and other 1000 x 1000 images but when I use large (3634x5451) image this is what happened.

CODE
const kernel = function(image) {
let x = this.thread.x,
y = this.thread.y;
const n = 4 * ( x + this.constants.w * (this.constants.h - y) );
this.color(image[n] / 256, image[n+1] / 256, image[n+2] / 256, image[n+3] / 256)
}
const drawImage = gpu.createKernel(kernel)
.setConstants({ w: width, h: height})
.setOutput([width, height])
.setGraphical(true)
drawImage(buffer)
const pixels = drawImage.getPixels()
gpu.destroy()
// write image file with returned pixels
Running on
- NodeJS : 14.17.3
- gpu.js : 2.11.3
- jpeg-js : 0.4.3
- AMD Radeon Pro 5300M
Original image
It should just redraw the same image.

Importance : 3
- 主要语言
- JavaScript
- 星标
- 15.5k
- 派生
- 666
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gpujs/gpu.js 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
-
WebGL backend silently returns all zeros for long-running kernels (no GL error, no context loss)未关闭
难度 5/5 一周以上 新手友好度 42/100
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
rescript-lang/rescript#8765 ·
维护者通常 1 天内回复
-
feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 62/100
githubnext/gh-aw-workshop#4417 ·
维护者通常 1 天内回复
-
Good First Issue hacktoberfest
难度 2/5 1-3 小时 新手友好度 85/100
hiero-ledger/hiero-sdk-js#4489 ·
维护者通常 1 天内回复
-
Add: RiC Feed未关闭check:passed feeds:add
难度 1/5 1 小时以内 新手友好度 74/100
维护者通常 9 天内回复