I was working on a web application that needed a barcode scanner that would work on all devices and platforms.
5 powerful libraries were selected. Three paid and two free.
Let's look at their main characteristics and highlight the pros and cons.
To compare how accurately they recognize the barcode, I chose different products with codes of different sizes and scanned them one by one without paying attention to the lighting.
For the experiment, I used two browsers on a 2011 Macbook and two browsers on an Android phone.
The results were evaluated on a 4-point scale and displayed in the table.
@ericblade/quagga2
- Free
- Weekly Downloads - 16000
- The new version of quagga is just now being developed and maintained
- Works well, but needs tweaking and testing
- Many different settings, integrates quickly
Since it is free, it also showed itself poorly in tests, worse than the rest
You can try it here
html5 qrcode
- Weekly Downloads - 12000
- Free
- Big community
- Powerful enough
- Easy to implement
- Flexible setup
dynamsoft-javascript-barcode
https://www.npmjs.com/package/dynamsoft-javascript-barcode
Cons: paid
10,000 barcode scan bundle - $1,249
50,000 barcode scan bundle - $2,999
100,000 barcode scan bundle - $4,999
- At first glance, less flexible, but everything you need is out of the box.
- It takes a little longer to set up than other paid options.
- Weekly Downloads - 9000
- It's solutions for various platforms and languages and supports many different code formats.
- 7-day free period to try
- You can test it here
- Actually, it doesn't work in Safari version 13 and below. But such users are less than 0.5%.
scanbot.io
Cons
- Paid: $25,000 per year
- A young library, so I did not pay attention to it.
- They have not had time to promote it yet, so a very small community. There are few stars on GitHub. And few downloads.
- Large library size
Pros
- There is a demo where you can test
- There is a trial license for 7 days.
- With many versions for different devices, it is frequently updated and supported.
- It works fast enough, not inferior to scandit-sdk. But there are no on-screen prompts and there is a little lack of interactivity.
Although it performed best in the tests, I would put it in second place.
And the Oscar goes...
scandit-sdk
https://www.npmjs.com/package/scandit-sdk
Cons: Paid solution, $25,000 per year
Pros
- It is a popular library
- Weekly Downloads - 47,000
- Easy to implement, with many functions out of the box
- Maybe not be as flexible as quagga2, but powerful and works with different kinds of codes.
- There are solutions for different platforms
- Showed good results in tests.
- You can test it here
Conclusion
Everything very much depends on the camera, device, browser, lighting, code size, and quality.
Of course, paid ones work faster, more reliably, and better, but free ones are also not much inferior to them.
Scandit-sdk seemed to me the best lib, it recognized the maximum number of codes on all devices and dealt with them very quickly. It is flexible but also expensive.
Other paid options showed no worse results and also deserve attention.
Among the free options, the Html5-code lib showed itself better, on Android in Chrome it was almost as good as paid solutions, but showed itself a little worse.
Of the four, Quagga2 screwed up the most. Although it is flexibly configured and looks good, it recognized the codes the least of all.
The article does not claim objectivity. The list of libraries may not be complete, so if you know of other libraries, feel free to comment.
Top comments (2)
Hi there!
Maintainer of Quagga2 here.
I'd be interested in seeing your code, and if possible images of the items that you were attempting to use. Of course, I know that there are improvements to be made, but I'd love to have your test suite to add to our existing tests, so that we can work to improve whatever you found lacking.
Also, your test links to the original version of the library, so if that's what you were using to test, then not the latest version of the code. Although there have only been very small improvements to the recognition layers since I forked, there have been a lot of improvements made to speed/efficiency.
As well, it would be helpful to know what device you were using for the mobile tests. For example, my brand new Razr drastically outperforms my previous Moto G, which drastically outperformed my previous G6, which drastically outperformed my previous Nexus 5. Every generation of phone has given us much better imaging and speed.
Thanks! Please feel free to open a Discussion on the Github board, or otherwise reach out to me. Have a great day. github.com/ericblade/quagga2/discu...
Hi there 👋
Author of STRICH (strich.io) here. It‘s the new kid on the block. 🙂
Nice comparison you created here, I would be very interested in the test dataset you used, and of course seeing how STRICH compares in your opinion.
If there is anything I can do to convince you to give it a try, let me know.
Kind Regards
Alex