<!-- Canonical page: https://reversedwithai.com/p/paint-net-direct2d-wine -->
Canonical page: https://reversedwithai.com/p/paint-net-direct2d-wine

# Clean-room Direct2D replacement for Paint.NET on WINE

> About 180,000 lines of clean-room Direct2D, so Paint.NET runs under WINE.

Paint.NET's author had Claude reverse engineer Direct2D's effect formulas and write a from-scratch replacement, about 180,000 lines, that ships behind a /wine switch.

## Key facts

- Target: Direct2D
- Category: APIs and protocols
- Platform: Windows / WINE
- Models: Claude
- Outcome: Partial
- Time spent (author-reported): About 3 weeks
- Checks: Source available: not reported; Repro steps: not reported; Real hardware: not reported; Verified by others: not reported
- Author: Rick Brewster
- Added: 2026-10-13
- Updated: 2026-10-13
- Sources reviewed: 2026-10-13 (editor)

## What was done

Rick Brewster, the author of Paint.NET, had Claude write a clean-room, reverse-engineered rewrite of Microsoft's Direct2D, so Paint.NET can run on WINE. The rewrite is about 180,000 lines of code. It ships inside Paint.NET as `PaintDotNet.Windows.Direct2D1.Managed.dll` and is used when the app starts with the `/wine` switch.

### How it was done

Brewster says Direct2D had always been the biggest hurdle for Paint.NET on WINE. WINE's own Direct2D support would never be complete enough, and Paint.NET cannot simply turn Direct2D off. So Brewster had Claude build a replacement from scratch. Brewster credits Claude with clever and tireless reverse engineering to work out the formulas behind Direct2D's built-in effects library. Brewster also says the work needed close supervision. For a while it skipped the COM equivalent of `AddRef()` on reference-counted objects, and Brewster had to correct some bad design and architecture decisions.

### Results

The replacement works well enough to ship as an extremely experimental WINE and Linux option. Brewster calls most of the code "vibe coded": it has not been thoroughly reviewed, and reviewing 180,000 lines is beyond the author's capacity. For scale, the rest of Paint.NET is about 700,000 lines, written over more than 20 years. Brewster says the work would not have happened without Claude. The quote comes from Simon Willison's blog, which links to the Paint.NET forum thread on WINE support.

## Human work and limitations

Brewster had to keep correcting Claude's resource management after it skipped COM reference counting (AddRef), and he pushed back on some poor design and architecture choices. He says the 180,000 lines are largely unreviewed.

## Sources

- [Write-up](https://simonwillison.net/2026/Sep/2/rick-brewster/)

Figures are reported by the author and not measured by this site, except the commit history. Entry drafted with AI from the linked sources and checked against them.

Cite as: Rick Brewster (2026). Clean-room Direct2D replacement for Paint.NET on WINE. Reversed with AI. https://reversedwithai.com/p/paint-net-direct2d-wine
