A cross-platform desktop application that converts images into automated mouse drag actions, allowing you to "replay" an image as a drawing.
- Image Parsing: Load images and analyze pixel data using multiple parsing algorithms
- Mouse Automation: Convert parsed image data to mouse drag sequences and replay them
- Color Management: Define custom color palettes, pick colors from screen, mark background colors
- Plugin Architecture: Extensible bitmap readers and brush changers
- Global Hotkeys: System-wide keyboard shortcuts for quick actions
- Live Preview: See how the image will be drawn before executing
DrawThatThing/
├── DrawThatThing.Avalonia/ # Main Avalonia UI application
├── DrawThatThing.Core/ # Platform-agnostic core library
├── DrawThatThing.Platform/ # Platform abstraction interfaces
├── DrawThatThing.Platform.Windows/ # Windows-specific implementations
├── DrawThatThing.Platform.macOS/ # macOS-specific implementations
├── DrawThatThing.Platform.Linux/ # Linux-specific implementations
├── DrawThatThing.sln # Solution file
├── build.sh # Build script for Linux/macOS
└── build.cmd # Build script for Windows
| Platform | .NET SDK | Additional Requirements |
|---|---|---|
| All | .NET 8.0 SDK or later | - |
| Windows | - | None (Win32 APIs included) |
| macOS | - | Accessibility permissions (System Preferences → Security & Privacy → Privacy → Accessibility) |
| Linux | - | X11, libXtst (XTest extension) |
# Using winget
winget install Microsoft.DotNet.SDK.8
# Or download from https://dotnet.microsoft.com/download/dotnet/8.0# Using Homebrew
brew install --cask dotnet-sdk
# Or download from https://dotnet.microsoft.com/download/dotnet/8.0# Add Microsoft package repository
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
# Install .NET SDK
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
# Install X11 dependencies for mouse automation
sudo apt-get install -y libx11-dev libxtst-devsudo dnf install dotnet-sdk-8.0
sudo dnf install libX11-devel libXtst-develsudo pacman -S dotnet-sdk
sudo pacman -S libx11 libxtst# Restore dependencies
dotnet restore DrawThatThing.sln
# Build in Debug mode
dotnet build DrawThatThing.sln
# Build in Release mode
dotnet build DrawThatThing.sln -c ReleaseOr use the provided build scripts:
# Linux/macOS
./build.sh
# Windows
build.cmddotnet run --project DrawThatThing.Avalonia/DrawThatThing.Avalonia.csprojCreate standalone executables that don't require .NET to be installed:
dotnet publish DrawThatThing.Avalonia -c Release -r win-x64 --self-contained -o publish/win-x64dotnet publish DrawThatThing.Avalonia -c Release -r win-arm64 --self-contained -o publish/win-arm64dotnet publish DrawThatThing.Avalonia -c Release -r osx-x64 --self-contained -o publish/osx-x64dotnet publish DrawThatThing.Avalonia -c Release -r osx-arm64 --self-contained -o publish/osx-arm64dotnet publish DrawThatThing.Avalonia -c Release -r linux-x64 --self-contained -o publish/linux-x64dotnet publish DrawThatThing.Avalonia -c Release -r linux-arm64 --self-contained -o publish/linux-arm64No additional configuration required. The application uses Win32 APIs for:
- Mouse control (
user32.dll- SetCursorPos, mouse_event) - Global hotkeys (
user32.dll- RegisterHotKey) - Screen capture (
gdi32.dll- BitBlt)
Important: You must grant Accessibility permissions for mouse automation to work.
- Open System Preferences (or System Settings on macOS Ventura+)
- Go to Security & Privacy → Privacy → Accessibility
- Click the lock icon to make changes
- Add DrawThatThing to the list and enable it
The application uses:
- CoreGraphics framework for mouse control (
CGEventCreateMouseEvent,CGEventPost) - Carbon framework for global hotkeys (
RegisterEventHotKey) - CoreGraphics for screen capture (
CGWindowListCreateImage)
Requires X11 and the XTest extension. Wayland is not currently supported for mouse automation.
Check if XTest is available:
xdpyinfo | grep -i xtestInstall dependencies:
# Ubuntu/Debian
sudo apt-get install libx11-6 libxtst6
# Fedora
sudo dnf install libX11 libXtst
# Arch
sudo pacman -S libx11 libxtstFor Wayland users: You may need to run the application under XWayland or switch to an X11 session for full functionality.
The application uses:
- X11 for mouse control (
XTestFakeMotionEvent,XTestFakeButtonEvent) - X11 for global hotkeys (
XGrabKey) - X11 for screen capture (
XGetImage)
| Hotkey | Action |
|---|---|
Shift+Alt+C |
Stop playback |
Shift+Alt+S |
Capture current mouse position |
Shift+Alt+A |
Add color at current cursor position |
Shift+Alt+D |
Toggle debug panel |
Shift+Alt+Q |
Add debug point |
Windows: Run the application as Administrator if mouse events are being blocked.
macOS: Ensure Accessibility permissions are granted (see macOS notes above).
Linux:
- Verify XTest extension is installed:
xdpyinfo | grep -i xtest - Ensure you're running under X11, not pure Wayland
All platforms: Verify .NET 8 SDK is installed: dotnet --version
Linux: Install missing dependencies:
sudo apt-get install libicu-dev libssl-devWindows: Another application may have registered the same hotkeys.
macOS: Grant Accessibility permissions and restart the application.
Linux: Ensure no other application is grabbing those key combinations.
- Project Page: http://egeozcan.github.com/DrawThatThing
- Issues: https://github.com/egeozcan/DrawThatThing/issues
This project is licensed under the GPL-3.0 License - see the LICENSE.txt file for details.
