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

Change fill_color while using image_factory #239

Open
marcofucito opened this issue Oct 6, 2021 · 1 comment
Open

Change fill_color while using image_factory #239

marcofucito opened this issue Oct 6, 2021 · 1 comment

Comments

@marcofucito
Copy link

Hello,
how can i change the the fill_color when using an image factory?

I have tried with the following two commands, but if I use the image factory, the fill_color command seems to be ignored:

img = qr.make_image(image_factory=StyledPilImage, fill_color=(255, 0, 0), embeded_image_path="test.png")
img = qr.make_image(image_factory=StyledPilImage, fill_color="red", embeded_image_path="test.png")

Thank you

@marcofucito marcofucito changed the title Change fill_color while using StyledPilImage /embeded_image_path Change fill_color while using image_factory Oct 6, 2021
@zigarn
Copy link

zigarn commented Nov 4, 2021

Workaround is to explicitly use SolidFillColorMask with front_color = the fill color:

img = qr.make_image(
  image_factory=StyledPilImage,
  module_drawer=SolidFillColorMask(front_color=(255, 0, 0)),
  embeded_image_path="test.png"
)

img = qr.make_image(
  image_factory=StyledPilImage,
  module_drawer=SolidFillColorMask(front_color="red"),
  embeded_image_path="test.png"
)

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