Skip to content

Commit 544e7de

Browse files
committed
Add ability to shuffle list
1 parent 50ab252 commit 544e7de

File tree

3 files changed

+19
-32
lines changed

3 files changed

+19
-32
lines changed

Image-Dict/convert.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,23 @@ def closest(colors,color):
4444
output_file.write("""]
4545
4646
# This code autogenerated by joe
47-
speed(0)
48-
resolution = """ + str(resolution) + """
49-
for current_pixel in image_list:
50-
split_pixel = current_pixel.split()
51-
x = split_pixel[0]
52-
y = 400 - int(split_pixel[1])
53-
selectColor = split_pixel[2]
47+
import random
48+
shuffleDraw = False # Change this to true to enable shuffled draw
49+
if shuffleDraw:
50+
random.shuffle(image_list)
51+
52+
speed(0) # Go at max speed
53+
resolution = """ + str(resolution) + """ # Set to res of image
54+
for current_pixel in image_list: # For every pixel
55+
split_pixel = current_pixel.split() # split into values on " "
56+
x = split_pixel[0] # The first value is x
57+
y = 400 - int(split_pixel[1]) # The second value is y
58+
selectColor = split_pixel[2] # The third value is color
5459
55-
penup()
56-
setposition(int(x) - 200, int(y) - 200)
57-
pendown()
58-
color(selectColor)
59-
pensize(resolution * 2)
60-
forward(resolution)
61-
print("Done")""")
60+
penup() # Bring up the cursor
61+
setposition(int(x) - 200, int(y) - 200) # Go to the pixel location (tranformed by 200)
62+
pendown() # Begin drawing
63+
color(selectColor) # Set the color
64+
pensize(resolution * 2) # Set the pen size
65+
forward(resolution) # Go forward
66+
print("Done") # Done!""")

Image-Dict/image.png

-131 KB
Binary file not shown.

Image-Dict/output.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)