Skip to content

QRCodeCanvas is sometimes blurry with fractional scaling zoom #373

@SerVB

Description

@SerVB

Hi,
I've noticed that QRCodeCanvas is sometimes isn't sharp when I apply zoom like 130%, so that my 512px QRCodeCanvas becomes 667px internally.

I guess it's because the calculated path to draw QR contains non-integer numbers (though I haven't time to check it).

Can perhaps the numbers in the path be rounded so that an always sharp QR is rendered? It will make modules have a bit different size (+- 1 pixel) but I guess it should be fine for scanners and also not so noticeable by people...

Another idea would be to ensure equal module sizes by shrinking the QR area and adding some additional margins. Though it can be unexpected because the margin size is already specified in modules, but more pixels will be added there.

Perhaps it could be a new setting like enum HandleScaling { FRACTIONAL_RENDERING /* current behavior */, ROUND, SHRINK }.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions