Ok, so we start of with `i` being at `data.length` or pixel count times four. `--i` takes `i`, decrements & saves it and then returns the result. We get `i == data.length - 1`, which means that we get last pixel's alpha. Second time `i` is used, its value will not get changed, so same pixels of `ref` and `new` are compared. Next time such line is executed, it ends up at `- 2`, which is blue of last pixel.

That repeats till we get to the first pixel. When the ~~last~~ first pixel's red gets evaluated, `i` is down to `0`, which terminates the loop.

Outright `* 4` would just evaluate the line once and multiply result by 4, so `--i` would only take effect once.