4

I have the following:

1 1 1 1 1 1 1   1   1   1 1   1     1 1 1 1 1 1 1 
1           1     1 1 1 1 1     1   1           1
1   1 1 1   1   1 1 1         1     1   1 1 1   1 
1   1 1 1   1   1 1 1   1   1 1     1   1 1 1   1 
1   1 1 1   1   1     1 1   1 1 1   1   1 1 1   1 
1           1       1 1   1     1   1           1 
1 1 1 1 1 1 1   1   1   1   1   1   1 1 1 1 1 1 1 
                    1   1     1 1                 
1 1 1 1     1   1   1 1 1 1   1 1 1     1 1 1   1 
    1         1     1   1 1 1   1     1   1       
1 1   1 1 1 1     1 1 1 1 1     1         1       
    1 1 1     1   1 1           1 1       1 1 1   
    1 1 1 1 1 1   1 1   1   1     1 1 1 1   1 1   
      1   1   1 1 1   1 1   1 1 1   1 1 1   1 1 1 
  1   1     1 1 1     1   1           1       1   
1   1 1 1 1     1   1 1     1         1       1 1 
    1   1 1 1 1 1   1   1   1   1 1 1 1 1   1 1   
                1   1       1 1 1       1 1 1   1 
1 1 1 1 1 1 1     1 1     1 1   1   1   1     1 1 
1           1     1   1   1 1 1 1       1         
1   1 1 1   1     1       1 1   1 1 1 1 1         
1   1 1 1   1   1 1 1             1 1   1 1   1 1 
1   1 1 1   1   1 1         1   1   1 1 1     1   
1           1   1     1 1 1 1     1       1 1     
1 1 1 1 1 1 1   1   1 1             1     1 1 1 1 

and it won't scan on a QR code reader. Is there any way I can change this into an actual QR code so that it is scannable?

6
  • what this ? pypi.python.org/pypi/PyQRCode Commented Jul 3, 2015 at 0:04
  • In what format? Also, it might work better if you used some other symbol then "1", like "#" or something more "filling". Commented Jul 3, 2015 at 0:06
  • @CrazyCasta in a format readable by a scanner haha. So I guess an image Commented Jul 3, 2015 at 0:06
  • @CrazyCasta right... i think too .. he need create an image or change 1 with black square Commented Jul 3, 2015 at 0:08
  • @CrazyCasta is there a way to replace a character with a pixel of color? Commented Jul 3, 2015 at 0:10

2 Answers 2

4

Since it appears you already know which squares to make black and which not, you could just use pillow to generate an image. You'll need to use ImageDraw and Image. What you need to do is something like:

from PIL import Image, ImageDraw
im = Image.new('1', (width, height), color=1) # Background white
draw = ImageDraw.Draw(im)
draw.point((x, y), 0) # Draw black
Sign up to request clarification or add additional context in comments.

Comments

1

I actually ended up turning the background of my text editor white, replacing all the 1 characters with two characters ██, taking a screenshot of it, and then scaling down the image so that it wasn't so spread out.

Just thought I'd add that in for completeness.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.