This is old but still relevant. I was writing a floodFill function to demonstrate recursion. (Flood fill is meant to fill an area of a graphic with single color, where "area" is a single, specific color touching other pixels with the same color. Drawing programs usually represent this feature with a spilling paint can.) My function worked properly in all browsers except FireFox because of an interesting user protection feature.
In FireFox, putImageData changes the specified colors subtlely before rendering them. getImageData returns the changed data. For example, if you specify opaque black (0x000000FF) for a pixel, the rendered and returned value might be 0x000200FF or 0x000001FF. It's not usually enough to notice visually, so it's not that big a deal until, of course, it is.
For example, I called my floodFill function to create the black triangle bounded by the cyan, light gray, and blue lines. FireFox renders it thusly:
This is the same image, blown up:
If the black area is then flood-filled with yellow, you might see the following result:
The flood-fill algorithm correctly misses single pixels which aren't exactly black (0x000000FF).
Why is FireFox purposely corrupting the data in this way? It's a feature that's enabled by setting "strict" privacy settings. It's meant to protect a FireFox user from fingerprinting graphics.
See https://www.h3xed.com/programming/javascript-canvas-getimagedata-pixel-colors-slightly-off-in-firefox for more information.