One-click flattened PNG & JPEG export directly from Paint.NET's File menu.
Paint.NET natively requires multiple clicks, flattening confirmations, format dialogs, and navigation steps just to export a flattened preview of a layered document. PaintDotNet-QuickExport integrates directly into Paint.NET's native File menu, adding instant, zero-dialog export options:
- Quick Export as PNG (
Ctrl + Alt + GorAlt + F, G) - Quick Export as JPEG (
Ctrl + Alt + JorAlt + F, J)
- Instant Flattening: Composites all visible layers into a buffer using Paint.NET's native rendering engine and saves immediately.
- Smart Path Detection: Automatically saves alongside your active file (e.g.
MyProject.pdn→MyProject.png/MyProject.jpg), or to your Desktop if the document hasn't been saved yet. - Alpha & Color Aware:
- PNG: Full 32-bit alpha transparency preserved.
- JPEG: Automatically composites transparent layers over a clean white background and encodes at 95% quality.
- Safe & Fully Reversible: The patcher automatically preserves
paintdotnet.orig.dllso you can restore your vanilla installation at any time with a single click. - Automated Patcher CLI:
- Auto-locates your Paint.NET installation (Current folder, Parent folder,
C:\Program Files\paint.net, or Windows Registry). - Supports automatic Windows UAC elevation if Paint.NET is in
Program Files. - Staging folder and side-by-side File Explorer opening fallback if you prefer manual copy/pasting.
- Auto-locates your Paint.NET installation (Current folder, Parent folder,
- Download the latest release from GitHub Releases and extract
QuickExportPatcher.exe(or build from source). - Run
QuickExportPatcher.exe. - The tool will auto-detect your Paint.NET installation:
- If located in
C:\Program Files\paint.net, the tool will offer to elevate via UAC to install the patch cleanly. - Alternatively, it stages the files and opens Explorer windows to both folders for easy drag-and-drop.
- If located in
- Launch Paint.NET, open an image with layers, and check the File menu!
Run QuickExportPatcher.exe and select option [2] Restore original Paint.NET (Unpatch). Your original paintdotnet.orig.dll will be restored immediately.
paintdotnet-quick-export/
|-- PaintDotNet.QuickExport.sln # Master solution file
\-- src/
|-- PaintDotNet.QuickExport/ # Companion DLL plugin (QuickExport)
| |-- PaintDotNet.QuickExport.csproj (Outputs PaintDotNet.QuickExport.dll)
| \-- Exporter.cs # UI injection and image flattening logic
\-- PaintDotNet.QuickExport.Patcher/ # Standalone automated patcher CLI
|-- PaintDotNet.QuickExport.Patcher.csproj (Outputs QuickExportPatcher.exe)
\-- Program.cs
Paint.NET v5.x runs on modern .NET 9 and uses Ahead-Of-Time (ReadyToRun) native compilation and strict menu item integrity checks. Standard plugin architectures only allow FileType and Effect plugins, neither of which can add hotkeyed actions to the root File menu.
To achieve seamless File menu integration, PaintDotNet-QuickExport utilizes a two-part hybrid design:
- Lightweight Binary Hook (
paintdotnet.dll):- Injects a dynamic reflection hook at the end of
PaintDotNet.Menus.FileMenu.OnDropDownOpening. This dynamically loadsPaintDotNet.QuickExport.dllfrom the application directory without introducing brittle static assembly references. - Bypasses internal menu membership checks (
FileMenu.OnDropDownItemClicked,PdnMenuItem.OnDropDownItemClicked, andPdnMainMenu.OnItemClicked), allowing standardToolStripMenuIteminstances to dispatch click events without throwingInvalidOperationException: Invalid menu item detected. - Preserves Win32 PE resources, GUI subsystem flags, and switches the CLR header to
ILOnlyto bypass stale native ReadyToRun offsets.
- Injects a dynamic reflection hook at the end of
- Companion Library (
PaintDotNet.QuickExport.dll):- Contains all the UI and export logic.
- Dynamically inspects
AppWorkspaceandActiveDocumentWorkspace. - Calls
curDoc.Flatten(surface)to perform native multi-layer compositing. - Encodes to PNG or high-quality JPEG and writes directly to disk.
- .NET 9 SDK
- Paint.NET 5.x installed (required for reference assemblies)
- Open
PaintDotNet.QuickExport.sln. - Press F5 (or Ctrl+F5) to build and launch the patcher.
(The solution is pre-configured to launch the Patcher project automatically. You can switch the configuration dropdown to Release for an optimized build).
- Open the repository root folder in VS Code.
- To Build: Press
Ctrl+Shift+Band chooseBuild (Debug)orBuild (Release). - To Run: Switch to the Run & Debug panel (
Ctrl+Shift+D), selectQuickExportPatcher (Debug)orQuickExportPatcher (Release), and pressF5(orCtrl+F5to run without debugging).
# Build the entire solution (Debug)
dotnet build
# Build in Release mode
dotnet build -c Release
# Run the patcher directly
dotnet run --project src/PaintDotNet.QuickExport.PatcherTo create a standalone, distribution-ready release zip containing the single-file executable, documentation, and a SHA-256 checksum:
- Via PowerShell:
./package.ps1 - Via VS Code: Press
Ctrl+Shift+P, selectTasks: Run Task, and choosePackage Release (.zip).
The output package will be placed in dist/QuickExportPatcher-v<Version>-win-x64.zip alongside dist/checksums.txt.
See CHANGELOG.md for release history and version notes.
This project is licensed under the MIT License.