Direct2D · Partial

Clean-room Direct2D replacement for Paint.NET on WINE

by Rick BrewsterRead the write-up Save and follow6 views
View JSON
Direct2D: About 180,000 lines of clean-room Direct2D, so Paint.NET runs under WINE.
Image: Title card: Reversed with AI

Who did what

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.

What was done

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.

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.

Discussion

Your library

Sources

Sources reviewed · Added

An AI model drafted this entry from the sources above. Checked against the sources on 13 Oct 2026. The figures are the author's. How entries are checked. Something wrong? Tell me.

The weekly dump: new projects, once a week