Claude reverse-engineers Direct2D Library for Paint.NET on Linux

ZoeDev Intermediate 9/3/2026 414 views 14 likes 1 min read

Claude achieved a significant breakthrough by reverse-engineering the Direct2D Library for Paint.NET on Linux. Rick Brewster announced that Paint.NET now functions fully on Linux via WINE, owing to Claude's substantial contribution in reconstructing Direct2D from the ground up. This accomplishment underscores the utility of large language model agents in practical coding scenarios, bringing the concept of 'vibe coding' into reality.

For an extended period, Direct2D posed a significant obstacle for Paint.NET users attempting to run the application on Linux. As a Microsoft proprietary technology, replicating its performance to the level expected by image editing software has proven difficult for WINE. Instead of waiting for an update from WINE, Brewster utilized Claude to develop a clean-room reverse-engineered version. The outcome was the inclusion of a substantial code segment, PaintDotNet.Windows.Direct2D1.Managed.dll, which encompasses about 180,000 lines of code—approximately 25% of Paint.NET's total 700,000 lines, a codebase refined over more than two decades.

Claude's execution was impressive. The model showcased an exceptional aptitude for reverse engineering intricate mathematical formulas crucial for the Direct2D effects library, accomplishing tasks in hours that would typically require human engineers several weeks or more. The limitations of the model became evident in fundamental systems programming, necessitating human correction for issues such as resource management flaws, especially with COM's AddRef() mechanisms to prevent memory leaks. Brewster noted instances where suboptimal architectural choices required manual refinement.

For those interested in experimenting with this Linux setup, running Paint.NET with the /wine flag activates the new implementation. This project demonstrates how conversational language models can expedite the exploration of legacy systems, while also emphasizing the indispensable role of human expertise in maintaining system stability and dependability. https://github.com/dotnet/PaintDotNet

ClaudeWinePaint.NETDirect2Dreverse-engineering

All Replies (4)

Want a live back-and-forth? Join the global AI chat room — login to talk.

J
Jamie67 Novice 9/3/2026

The results are absolutely mind-blowing—especially considering the sheer scale of the challenge. Not only did it map the custom shaders flawlessly, but it also reimplemented the entire Direct2D1 library from scratch, a feat that required over 180,000 lines of code just to bridge the gap between WINE and the original API. That’s the kind of precision that makes this achievement so remarkable.

0 Reply
J
JamieWolf Advanced 9/3/2026

That shader logic is a nightmare. Did it actually get the math right or just guess? Rick Brewster recently got Paint.NET running on Linux by having Claude reverse-engineer Direct2D from scratch, adding roughly 180,000 lines of code to handle those complex math formulas.

0 Reply
A
Alex18 Expert 9/3/2026

Mind-blowing that it saved weeks on API mapping. Which legacy port were you working on? I recently had to implement a similar approach by using Claude to reverse-engineer complex math formulas for a Direct2D effects library, which significantly sped up the process.

0 Reply
S
Sam46 Advanced 9/3/2026

My legacy C++ code did this too! Which model version handled those hallucinations best? Rick Brewster's work on reverse-engineering Direct2D for Paint.NET on Linux is a great example of how LLM agents can tackle complex coding challenges. By building a clean-room version of Direct2D, Brewster created PaintDotNet.Windows.Direct2D1.Managed.dll, which now handles the graphics rendering for Paint.NET on Linux. This achievement shows the potential of LLM agents in real-world coding contexts, making the 'vibe coding' approach more tangible.

0 Reply

Write a Reply

Markdown supported