Skip to content

Improve QRCode output sharpness #404

@DanielHolland

Description

@DanielHolland

Hi there,

[ ] Bug
[X] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

I am looking at using this package in place of calling Google's Chart API to generate QRCodes, the implementation I've followed uses the basic example in Wiki. What I see is that the image output of the library is noticeably blurred / pixelated when compared to the output from Google Chart.

Screenshot 2022-06-01 at 12 00 19

What can I do to improve on the image sharpness?

var url = "https://github.com/codebude/QRCoder/issues/new";
QRCodeGenerator _qrCode = new QRCodeGenerator();
QRCodeData _qrCodeData = _qrCode.CreateQrCode(url, QRCodeGenerator.ECCLevel.L);
PngByteQRCode qrCode = new PngByteQRCode(_qrCodeData);
byte[] qrAsPngByteArray = qrCode.GetGraphic(20);
using(var ms = new MemoryStream(qrAsPngByteArray))
{
    testQRCode.Image = new Bitmap(ms);
}
  • Version used: 1.4.3
  • Compiled from source or NuGet package?: Nuget
  • Payload/Encoded text: "https://github.com/codebude/QRCoder/issues/new"
  • Used payload generator: QRCodeGenerator
  • Used ECC-level: L
  • Used renderer class: PngByteQRCode
  • Environment (.NET 3.5, .NET 4.X, .NETCore, ...): .NET 4.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions