zxpsuper / qrcode-with-logos

A plugin for generating QR codes with a logo and styling.
https://zxpsuper.github.io/qrcode-with-logos
MIT License
137 stars 41 forks source link

Loaded QRCode not sharp enough #39

Closed AmoabaKelvin closed 4 days ago

AmoabaKelvin commented 1 month ago

Creating a qrcode and rendering on a page makes it look kinda blurred. It does not look soo sharp

image

zxpsuper commented 1 month ago

@AmoabaKelvin I think that maybe width 380 is too small so that qrcode is not sharp enough.

I set the width to 1000 and it looks better.

let qrcode = new QrCodeWithLogo({
    content: "https://github.com/zxpsuper",
    width: 1000,
    image: document.getElementById("image"),
    logo: {
      src: 'https://avatars.githubusercontent.com/u/28730619?v=4'
    },
    dotsOptions: {
      type: 'dot'
    },
    cornersOptions: {
      type: 'circle-diamond'
    },
    nodeQrCodeOptions: {
      margin: 20
    }
  });

image