Skip to content

How to create a QR with a small pixel size. #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuya-tani opened this issue Apr 19, 2022 · 3 comments
Closed

How to create a QR with a small pixel size. #396

yuya-tani opened this issue Apr 19, 2022 · 3 comments

Comments

@yuya-tani
Copy link

yuya-tani commented Apr 19, 2022

Hi.
I always use QR Coder. Thank you.

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

I want to make a QR with a fairly small size. (SVG mode)
Specifically, it is a QR with a cell size of 0.33 mm.

The "pixelsPerModule" parameter of the "GetGraphic" method is
It is int, and if you create a QR by setting the minimum value of 1,
The size of one cell was 0.35 mm.
Since it is an int, it is not possible to specify a decimal number smaller than 1, but is it possible to create a QR with a smaller size?

Best regard.

@Shane32
Copy link
Contributor

Shane32 commented Apr 14, 2024

The current version has a bug where pixelSizeFactor is ignored. See PR #408 for the fix.

@Shane32
Copy link
Contributor

Shane32 commented Apr 14, 2024

Actually, that's for the dot size relative to the cell size. It is true that you cannot set the cell size to a non-integer. However, a SVG is scalable; you can always scale it without losing quality.

@codebude
Copy link
Owner

However, a SVG is scalable; you can always scale it without losing quality.

That's all to be said. Changing the size really doesn't matter. There is nothing like a "smaller" SVG. The SVG file will noticeably change in filesize, no matter if the target size is 1mm or 20m as SVG is a vector format. If you want to show/render the SVG really small, just set the scale when rendering the SVG in your application/website.

Check:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants