DrawPrompt is a desktop application for creating physical drawing datasets. It generates printable pages with ArUco marker-tagged squares for prompts, then extracts hand-drawn artwork from scanned pages back into digital form. Perfect for training AI models on hand-drawn artwork or creating physical drawing datasets.
The workflow is simple:
- Generate printable template pages from a list of text prompts
- Print the pages and draw in each square
- Scan the completed pages
- Extract individual drawings as labeled images with metadata
Each prompt square is marked with ArUco markers at the corners, enabling automatic detection and extraction of drawings even from imperfect scans.
# Clone the repository
git clone git@github.com:jbartolozzi/DrawPrompt.git
cd DrawPrompt
# Initialize the submodule
git submodule update --init
# Run Setup
source setup.shThe Generate Templates tab allows you to create printable pages:
-
Prompts List (left panel): Add, edit, and reorder your text prompts
- Double-click "(Double-click to add prompt)" to add new prompts
- Double-click any prompt to edit it
- Drag prompts to reorder them
- Press Delete/Backspace to remove prompts
- Import/Export buttons: Load prompts from or save to
.txt,.csv, or.jsonlfiles
-
Page Settings:
- Squares per page: Number of prompt squares per page (1-20)
- Padding: Space between squares in pixels (10-300)
- Title: Custom title text for your pages
-
Action Buttons:
- Generate Preview: Manually refresh the preview
- Print Pages: Send pages directly to your printer
- Save as PNG: Export pages as PNG image files
-
Preview Panel (right): Live preview of your generated pages
- Automatically updates when you change prompts or settings
- Page Navigation: Browse through multiple pages with Previous/Next buttons
The Scan & Extract tab processes scanned pages to extract individual drawings:
-
Input File:
- Browse button: Select a scanned image file
- Drag and drop a scanned image directly onto the preview area
- Supports PNG, JPG, JPEG formats
-
Prompts File:
- Load Prompts button: Load the original prompts file used to generate the pages
- This associates each extracted image with its corresponding prompt text
-
Extraction Settings:
- Output size: Resolution of extracted images in pixels (128-2048)
- Select Output Folder: Where to save extracted images and metadata
- Use fallback mode: If ArUco marker detection fails, use fixed grid positions (for 600 DPI scans)
-
Extract Images button: Start the extraction process (threaded operation)
-
Progress bar: Shows extraction progress
-
Log panel: Displays status messages and any errors
-
Preview Panel (right): Shows the loaded scanned image before processing
Here are two example scanned pages showing hand-drawn artwork in each prompt square. The ArUco markers at each corner enable precise extraction.
The extracted drawings from the first scan (left) were used to train a LoRA model, which then generated new artwork in the same style (right).
The second scan demonstrates different artistic styles. The trained model successfully learned and replicated the unique characteristics of each drawing style.
Extracted images are saved with the following structure:
output_folder/
├── image_0.png
├── image_1.png
├── image_2.png
├── ...
└── metadata.jsonl
The metadata.jsonl file contains prompt associations:
{"file_name": "image_0.png", "prompt": "a cat wearing a hat"}
{"file_name": "image_1.png", "prompt": "a house with a garden"}Both generation and scanning can be done via command-line:
python3 core/create_image.py \
-p prompts.txt \
-o output/ \
-s 12 \
-a 100 \
-t "My Drawing Prompts" \
-f# With ArUco marker detection
python3 core/scan_image.py \
-i scan.jpg \
-p prompts.txt \
-o output/ \
--scale 512
# Fallback mode (fixed positions)
python3 core/scan_image.py \
-i scan.jpg \
-p prompts.txt \
-o output/ \
--scale 512 \
--dumbBuild a standalone macOS application bundle:
pyinstaller DrawPrompt.specThe built app will be in dist/DrawPrompt.app/
- ArUco Markers: Uses OpenCV's DICT_4X4_250 dictionary with 4 markers per square
- Print Resolution: Pages are generated at 300 DPI (2550×3300 px) for high-quality printing
- Scan Resolution: Works best with 300-600 DPI scans
- Detection: Automatically optimizes ArUco detection parameters for each scan
- Fallback Mode: If marker detection fails, uses fixed grid positions calibrated for 600 DPI scans
Built with:






