I am iterating over some image data pulled from a canvas like so:
canvas
var imageData = this.context.getImageData(0, 0, this.el.width, this.el.height)
Corrected and tested version of code:
var x = (i / 4) % this.el.width; var y = Math.floor((i / 4) / this.el.width);