nimiq / qr-creator

Lightweight library for stylish QR codes
https://nimiq.github.io/qr-creator/demo
MIT License
200 stars 24 forks source link

High-res support #12

Open intellent opened 1 year ago

intellent commented 1 year ago

Love this lib and how minimal and dependency-free it is!

One rather minor issue I stumbled across: On higher-res displays (like modern mobile phones) the QR code gets somewhat blurry. I tried rendering it in double-resolution and scale it down via CSS. However, this results in a blurry QR code on “normal” resolution displays (at least when applying the neat rounded-corner effect).

It would be nice to have either a vector version or something similar to multi-size srcsets like supported by img. Don’t know if this is possible with canvas, though.

Or maybe there’s another way?

<img srcset="qr-2x.png 2x, qr.png  1x" src="qr.png">