Is canvas getImageData method machine/browser dependent?

前端 未结 1 1783
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 12:57

A client required help with a program that extracts the dominant color of a product image.

I was able to quickly implement this in Javascript; the algorithm below o

相关标签:
1条回答
  • 2020-11-29 13:39

    Yes. This fact is exploited by canvas fingerprinting:

    The same HTML5 Canvas element can produce exceptional pixels on a different web browsers, depending on the system on which it was executed.

    This happens for several reasons: at the image format level — web browsers uses different image processing engines, export options, compression level, final images may got different hashes even if they are pixel-perfect; at the pixmap level — operating systems use different algorithms and settings for anti-aliasing and sub-pixel rendering. We don't know all the reasons, but we have already collected more than a thousand unique signatures.

    0 讨论(0)
提交回复
热议问题