how to get data from canvas pixel code example Example: getImageData() ctx.getImageData(sx, sy, sw, sh);