code-kotis / qr-code-scanner

📠 A simple, fast and useful progressive web application
https://qrcodescan.in
MIT License
1.05k stars 291 forks source link

Do not detect colors? #81

Open Vogod opened 4 years ago

Vogod commented 4 years ago

First of all, congratulations on the scanner and thanks for sharing.

I have created a QR code with colors and the reader does not read it. Can it be configured in any way?

If I try to read the code with the iPhone camera, it does recognize it.

I have done the test at https://www.qrcode-monkey.com. If I create a code in black on a white background, the scanner reads it. If I take, for example, yellow over red background, the scanner is not able to read it.

Thanks!

gitbreaker222 commented 4 years ago

yellow over red background

Several years ago I worked with QR codes in University. At that time I've read somewhere, that QR-Code specification says, that the "pixels" and anchors have to be dark and the background light, but some scanners can read inverted QR codes, because they internally invert the camera image.

Some reference I just searched for: http://qrcode.meetheed.com/question2.php?s=s

So my suggestion to ensure best readability for your QR-Code: Always use dark "pixels" and light background. You may want to test the colored code, by applying a grayscale filter and check if the contrast is clearly visible.

Does this solve this issue @Vogod ?

gokulkrishh commented 4 years ago

@gitbreaker222 Good suggestion 👍 @Vogod Try gitbreaker suggestion and let us know.