cozmo / jsQR

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.
https://cozmo.github.io/jsQR/
Apache License 2.0
3.7k stars 607 forks source link

Can i decode this images? #125

Closed ternaryCat closed 5 years ago

ternaryCat commented 5 years ago

i tryed this demo https://codesandbox.io/s/pwoywz6n5x

it can't decode qr with custom background/logo

Is there way decode images ? image3 image4

atkulp commented 5 years ago

Any QR code scanner is going to need enough contrast between black and white squares. This one has a beer glass in front if it though. I can't imagine any reader liking it.

ternaryCat commented 5 years ago

jsQR was able to scan this image, the problem was that he does not perceive the image if there are transparent pixels on it

cozmo commented 5 years ago

Yea we decided not to support transparent pngs, since transparent pixels have undefined behavior. For example for people with inverted QR codes (white modules on black backgrounds), assuming transparent pixels were white would cause the QR codes not to scan.

If you know you can safely assume transparent pixels are a certain color you should be able to easily process the input data to encode that assumption. If you think we should support transparent images please open an issue (or better, a PR) and I'm happy to discuss.