Paint.NET image

From Just Solve the File Format Problem
Revision as of 15:48, 12 November 2023 by Pinata (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
File Format
Name Paint.NET image
Ontology
Extension(s) .pdn

Paint.NET image (or PDN) is the native graphics file format of the Paint.NET image editor for Microsoft Windows.

Contents

Format

A PDN file mainly consists of .NET serialized data, which reflects the Document class in Paint.NET's C# code. Because of this, parsing a PDN file requires either parsing the .NET binary format, or if you're in a .NET environment, simply including some of the Paint.NET .dll files in your project and letting .NET do the rest (although Microsoft advises against it).

There seems to be two versions of the PDN format; the older one simply compresses the .NET data through Gzip. The current one features its own file format signature, the ASCII characters "PDN3", as well as some metadata (width, height, thumbnail) in XML format, prefixed with its length as a little-endian 24-bit integer. The .NET serialized data can still be compressed, but it's now optional, denoted by the 0x1F 0x8B prefix for Gzip compression, or 0x00 0x01 for uncompressed.

Bitmap data is stored as BGRA, and can be optionally serialized separately from the .NET data if its respective layer declares that the bitmap data is deferred. If so, bitmap data shows up right after the .NET data, optionally Gzip compressed. Deferred data is ordered based on the layer ordering.

Identification

Files begin with a signature: the ASCII characters "PDN3". The older version of the PDN format starts with the Gzip signature bytes, 0x1F 0x8B.

Specifications

Software

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox