heuer / qrcode-artistic

Segno plugin to convert (Micro) QR Codes to Pillow/PIL
BSD 3-Clause "New" or "Revised" License
35 stars 5 forks source link

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

Closed RenatoOtescuRW closed 4 years ago

RenatoOtescuRW commented 4 years ago

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

heuer commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

out-scale-36