diff --git a/README.md b/README.md index 2c1ae6c..50c5c50 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # auto-draw Drawing automation with PyAutoGUI + +# Listen to examples +[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/St48jGas_60/0.jpg)](https://www.youtube.com/watch?v=St48jGas_60&list=PLLfIBXQeu3abdRtBW4xHy96--R5OIwK2a) + +# Install dependencies + pip install pyautogui + +# How to use it +1. Open your favourite graphics editor +2. Adjust cursor starting position in "draw.py" if needed +3. Run the script in console via: "python draw.py" + + diff --git a/src/draw.py b/src/draw.py index e1aa30c..49aaa02 100644 --- a/src/draw.py +++ b/src/draw.py @@ -26,9 +26,9 @@ (thresh, blackAndWhiteImage) = cv2.threshold(grayImage, 127, 255, cv2.THRESH_BINARY) # uncomment below lines to preview image -#cv2.imshow('Black white image', blackAndWhiteImage) -#cv2.waitKey(0) -#cv2.destroyAllWindows() +cv2.imshow('Black & white image', blackAndWhiteImage) +cv2.waitKey(0) +cv2.destroyAllWindows() # global coordinates of where to start drawing (change if needed!) x_start = 100 @@ -44,8 +44,8 @@ random_rows = list(range(len(blackAndWhiteImage))) # comment two lines below if you want a "printer" like behavior -#random_rows = random.sample(range(len(blackAndWhiteImage)), len(blackAndWhiteImage)) -#random.shuffle(random_rows) +random_rows = random.sample(range(len(blackAndWhiteImage)), len(blackAndWhiteImage)) +random.shuffle(random_rows) # loop over pixel rows for y in random_rows: @@ -59,6 +59,7 @@ if row[x] == 0: # draw pixel! pg.click(x_start + x, y_start + y, _pause=False) + print('Drawing at:', x_start + x, y_start + y) # animation speed time.sleep(0.008) diff --git a/src/image.png b/src/image.png index 73ebdef..5dd8028 100644 Binary files a/src/image.png and b/src/image.png differ