Skip to content
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

Using large scale with qrcode_artistic results in blurry QR image #4

Closed
RenatoOtescuRW opened this issue Sep 1, 2020 · 3 comments
Closed

Comments

@RenatoOtescuRW
Copy link

Hello,

When I create a QR code pointing to https://en.wikipedia.org/wiki/Main_Page with the scale set to 35 and with an image background using qrcode_artistic, the resulting QR image is very blurry even if the provided image is large.
If I use segno alone to create a simple QR, the resulting image is crisp.

This is the code:

image = 'firefoxLogo.png' qr = segno.make('https://en.wikipedia.org/wiki/Main_Page', micro=False) qrSimple = qr.save('outSimple.png', scale=35, border=1) qrArtistic = qr.to_artistic(background=image, border=1, target='outArtistic.png', scale=35)

Simple QR:
outSimple

Artistic QR
outArtistic

And the logo file I have used:
firefoxLogo

@RenatoOtescuRW RenatoOtescuRW changed the title Large scale makes QR blurry Large scale with qrcode_artistic makes QR blurry Sep 1, 2020
@RenatoOtescuRW RenatoOtescuRW changed the title Large scale with qrcode_artistic makes QR blurry Using large scale with qrcode_artistic makes QR blurry Sep 1, 2020
@RenatoOtescuRW RenatoOtescuRW changed the title Using large scale with qrcode_artistic makes QR blurry Using large scale with qrcode_artistic results in blurry QR image Sep 1, 2020
@heuer
Copy link
Owner

heuer commented Sep 1, 2020

Thanks for your report. It's a known problem: The algorithm shrinks the QR code, draws the background and enlarges the resulting image if necessary.

I'll try to come up with a better solution.

@RenatoOtescuRW
Copy link
Author

RenatoOtescuRW commented Sep 1, 2020

Thanks for your report. It's a known problem: The algorithm shrinks the QR code, draws the background and enlarges the resulting image if necessary.

I'll try to come up with a better solution.

thank you for the quick reply!

I realized that might be the culprit when I looked through your code. I played a bit with the scaling but it conflicts with the segno consts, this being the result:

outArtisticNewScaling

@heuer
Copy link
Owner

heuer commented Sep 4, 2020

Thanks for your patience, I make a release today that fixes the problem.

out-scale-36

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

No branches or pull requests

2 participants