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

Support specifying greyscale weights and use integer approximation if desired #116

Open danimoh opened 5 years ago

danimoh commented 5 years ago

Hello Cosmo.

I don't know whether you're interested in a change like this, but as I needed it myself, I thought I might as well open up a pull request. It's not documented in the README yet, but if you're interested, I can add it.

The idea is to provide an option to adapt the weights used in grayscale computation to adapt to differently gamma corrected images or to optimize contrast for colored qr codes, if the used color is known upfront. Also if desired, a faster integer approximation can be used.