Paint Buddy

Overview

Paint Buddy automates digital painting in Microsoft Paint by converting a black-and-white image into horizontal strokes using Python.

It leverages OpenCV for image binarization and PyAutoGUI for mouse control, delivering pixel-art style drawing without manual effort.

Key Features

  • Processes images into binary (black/white) horizontal line segments for drawing
  • Uses OpenCV thresholding to convert greyscale visuals into drawable format
  • Automates drawing with PyAutoGUI by simulating mouse drags and clicks
  • Runs without extra configuration—just run the script to start painting

Purpose & Vision

Paint Buddy showcases creative automation by merging computer vision with UI scripting to generate digital artwork in Paint.

Its vision is to make coding art intuitive, enabling users to transform images into live drawings with minimal setup and maximum creativity.

Technologies Used

  • Python — Core language for orchestrating the automation process
  • OpenCV — Handles image loading, grayscale conversion, and thresholding :contentReference[oaicite:0]{index=0}
  • PyAutoGUI — Drives mouse movements and clicks to simulate drawing actions :contentReference[oaicite:1]{index=1}
  • Requirements.txt — Defines necessary dependencies for setup and execution :contentReference[oaicite:2]{index=2}

Workflow

  1. Clone the repository and install dependencies via requirements.txt :contentReference[oaicite:3]{index=3}
  2. Run the main script: python main.py path/to/image.png :contentReference[oaicite:4]{index=4}
  3. Script loads the image in grayscale and applies binary thresholding using OpenCV :contentReference[oaicite:5]{index=5}
  4. It iterates through each image row; for black pixels, simulates a mouse drag; for white, moves to next position :contentReference[oaicite:6]{index=6}
  5. Result: the image is recreated in Paint using mouse automation movements

Results & Impact

  • Visualizes complex black-and-white images inside Paint through automation
  • Serves as a fun, creative demonstration merging image processing with UI scripting
  • Requires no GUI from user—just supply an image and watch it draw itself

Future Enhancements

  • Add emergency stop via PyAutoGUI failsafe (move mouse to corner) :contentReference[oaicite:7]{index=7}
  • Introduce curve detection or edge-guided strokes rather than horizontal-only lines
  • Provide options for color drawing by expanding beyond black-and-white inputs

Conclusion

Paint Buddy transforms static images into live Paint artwork using OpenCV and PyAutoGUI. It’s a creative and efficient way to explore code-driven art.