lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.43k stars 676 forks source link

Add Styles #168

Closed digitaltembo closed 3 years ago

digitaltembo commented 5 years ago

This adds a image factory "StyledPilImage" which can paint QR codes with different color schemes, with different module shapes, and with an embedded image. See the updated README for example usages, and see the added images for examples of what the different styling options can do.

I modified the make_image function a bit to pass in the "context" of a given module if the image factory wants the context (used to determine what neighboring modules also need to be painted, for determining shapes), and to call a "process" function afterwards again only if the image factory wants for processing. It should leave present behavior in place, but allow for more complicated image factories (including StyledPilImage).

This is my first PR, so I'm probably doing something wrong, apologies for that. And thanks for an awesome and relatively intuitive library!

Changing the module drawers: module_drawers Changing the color masks: color_masks

Aurnytoraink commented 5 years ago

Can you think we can go even further by changing the look of the markups and the inside of them. Here is a prototype qrcode