Alex-Skillman/OS-Paint

A drawing tool that can be used to draw P2P or alone

Rust

1

28 commits

updated Sep 23, 2026

See the code

See what people are saying

SourceMessageScoreDate

I HATE MS Paint, so I made OS-Paint (r/opensource)

I tried using MS Paint to teach someone and when I tried it was awful. After trying to share my screen and call, it just didn't work. I never had been so frustrated with a piece of software before. Over the course of the past few weeks, I have made OS-Paint, a open source P2P (or not) drawing tool.…

0

Sep 23, 2026

README

OS-Paint

A real-time collaborative whiteboard. Draw on a shared canvas with friends over a peer-to-peer connection — no accounts, no installs beyond the app itself, just a room code.

Built in Rust with macroquad for rendering/input and matchbox for WebRTC peer-to-peer networking.

Features

  • Shared canvas — a fixed-size (3200×2400) drawing surface everyone in a room sees identically, panned and zoomed independently per viewer.
  • Tools — pen, point eraser, and stroke eraser (removes whole strokes at once), each with an adjustable size.
  • Color picker — a quick-pick palette (defaults plus your most recently used colors) and a full hue/saturation color wheel.
  • Undo/redo — up to 50 steps, synced to peers so everyone converges on the same canvas.
  • Live peer cursors — see where everyone else in the room is pointing and what color they're about to draw with.
  • Lobbies — host a room to get a random 6-digit code, or join one someone shares with you. No sign-up required.

Controls

ActionInput
DrawLeft-click drag (Pen tool)
EraseLeft-click drag (Eraser / Stroke Eraser tool)
PanRight-click drag
ZoomMouse wheel
Change tool sizeUp / Down arrow keys
Switch to PenD
Switch to EraserE
Switch to Stroke EraserR
UndoCtrl+Z
RedoCtrl+Y
Open menu (host/join/leave lobby)Esc

Running from source

Requires a Rust toolchain.

cargo run --release

By default the app connects to a public signaling server for matchmaking. To point it at your own instead, set OS_PAINT_SIGNALING_SERVER before launching:

OS_PAINT_SIGNALING_SERVER=wss://your-signaling-server.example {your binary}

Prebuilt binaries

Every push builds Windows, macOS, and Linux binaries via GitHub Actions (see .github/workflows/build.yml); grab them from that workflow's run artifacts, or from the latest release, which is republished automatically on every push to master.

Project layout

FileResponsibility
src/main.rsApp loop: state, input dispatch, undo/redo, lobby lifecycle
src/canvas.rsCanvas dimensions, pan/zoom clamping, screen↔canvas coordinate mapping
src/stroke.rsStroke and Tool types
src/input.rsMouse/keyboard handling for drawing, erasing, panning, zooming
src/render.rsDrawing strokes, the canvas border, and peer cursors to screen
src/ui.rsToolbar, size slider, color wheel, and their icons
src/menu.rsPause menu: host/join/leave a lobby
src/network.rsPacket types and WebRTC peer sync (strokes, erases, snapshots, cursors)

How networking works

Rooms are just everyone who connects to the signaling server with the same 6-digit code — there's no dedicated game server holding state. Each peer:

  • Broadcasts individual draw/erase actions to connected peers as they happen.
  • Sends a full canvas snapshot to any newly-joined peer, and periodically (every 30s) to all peers, so late joiners and anyone who missed a packet converge on the same canvas.
  • Resolves conflicting snapshots by revision number, always keeping the newer one.

Contributors

Alex-Skillman

28 commits

Alex-Skillman/OS-Paint

A drawing tool that can be used to draw P2P or alone

Rust

1

28 commits

updated Sep 23, 2026

See the code

See what people are saying

SourceMessageScoreDate

I HATE MS Paint, so I made OS-Paint (r/opensource)

I tried using MS Paint to teach someone and when I tried it was awful. After trying to share my screen and call, it just didn't work. I never had been so frustrated with a piece of software before. Over the course of the past few weeks, I have made OS-Paint, a open source P2P (or not) drawing tool.…

0

Sep 23, 2026

README

OS-Paint

A real-time collaborative whiteboard. Draw on a shared canvas with friends over a peer-to-peer connection — no accounts, no installs beyond the app itself, just a room code.

Built in Rust with macroquad for rendering/input and matchbox for WebRTC peer-to-peer networking.

Features

  • Shared canvas — a fixed-size (3200×2400) drawing surface everyone in a room sees identically, panned and zoomed independently per viewer.
  • Tools — pen, point eraser, and stroke eraser (removes whole strokes at once), each with an adjustable size.
  • Color picker — a quick-pick palette (defaults plus your most recently used colors) and a full hue/saturation color wheel.
  • Undo/redo — up to 50 steps, synced to peers so everyone converges on the same canvas.
  • Live peer cursors — see where everyone else in the room is pointing and what color they're about to draw with.
  • Lobbies — host a room to get a random 6-digit code, or join one someone shares with you. No sign-up required.

Controls

ActionInput
DrawLeft-click drag (Pen tool)
EraseLeft-click drag (Eraser / Stroke Eraser tool)
PanRight-click drag
ZoomMouse wheel
Change tool sizeUp / Down arrow keys
Switch to PenD
Switch to EraserE
Switch to Stroke EraserR
UndoCtrl+Z
RedoCtrl+Y
Open menu (host/join/leave lobby)Esc

Running from source

Requires a Rust toolchain.

cargo run --release

By default the app connects to a public signaling server for matchmaking. To point it at your own instead, set OS_PAINT_SIGNALING_SERVER before launching:

OS_PAINT_SIGNALING_SERVER=wss://your-signaling-server.example {your binary}

Prebuilt binaries

Every push builds Windows, macOS, and Linux binaries via GitHub Actions (see .github/workflows/build.yml); grab them from that workflow's run artifacts, or from the latest release, which is republished automatically on every push to master.

Project layout

FileResponsibility
src/main.rsApp loop: state, input dispatch, undo/redo, lobby lifecycle
src/canvas.rsCanvas dimensions, pan/zoom clamping, screen↔canvas coordinate mapping
src/stroke.rsStroke and Tool types
src/input.rsMouse/keyboard handling for drawing, erasing, panning, zooming
src/render.rsDrawing strokes, the canvas border, and peer cursors to screen
src/ui.rsToolbar, size slider, color wheel, and their icons
src/menu.rsPause menu: host/join/leave a lobby
src/network.rsPacket types and WebRTC peer sync (strokes, erases, snapshots, cursors)

How networking works

Rooms are just everyone who connects to the signaling server with the same 6-digit code — there's no dedicated game server holding state. Each peer:

  • Broadcasts individual draw/erase actions to connected peers as they happen.
  • Sends a full canvas snapshot to any newly-joined peer, and periodically (every 30s) to all peers, so late joiners and anyone who missed a packet converge on the same canvas.
  • Resolves conflicting snapshots by revision number, always keeping the newer one.

Contributors

Alex-Skillman

28 commits

Languages

Rust

100.0%