Use this command to install Netpbm Windows Imaging Component Codec:
winget install --id=TeamCharLS.NetpbmWicCodec -e
Netpbm Windows Imaging Component Codec is a Windows Imaging Component (WIC) codec designed to enable decoding of .pgm, .ppm, and .pam files within Windows applications that leverage WIC codecs. This tool allows users to view Netpbm-encoded images in Windows Photo Viewer, Windows Explorer (including thumbnails), and import these images into Microsoft Office documents.
Key Features:
Decoding support for .pgm, .ppm, and .pam file formats.
Compatibility with various bit depths and color models, including grayscale and RGB.
Integration with Windows applications that use WIC codecs.
Available for installation via winget.
Audience & Benefit:
Ideal for users who work with Netpbm files and need seamless integration with Windows applications. This codec enables efficient viewing and handling of images without requiring additional software or workflows.
README
Netpbm Windows Imaging Component Codec
This Windows Imaging Component (WIC) codec makes it possible to decode .pgm and .ppm files with Windows applications that can leverage WIC codecs.
It makes it possible to view Netpbm encoded images in Windows PhotoViewer, Windows Explorer (including thumbnails)
and import these images in Microsoft Office documents.
It is a C++ 23 implementation originally based on the PNM WIC Image Codec project.
It leverages the C++/WinRT framework to implement the classic COM components required for a WIC codec and uses Wix for the installer.
Introduction
Netpbm is the name of an open source package of graphics programs and a programming library.
It defines several graphics formats that are not compressed but are easy to exchange between different
platforms:
Type
Extension
Magic number
Color model
Portable BitMap
.pbm
P1,P4
0-1 (white & black)
Portable GrayMap
.pgm
P2,P5
0-255, 0-65535 * 1 channel (gray scale)
Portable Pixel Map
.ppm
P3,P6
0-255, 0-65535 * 3 channels (RGB)
Portable AnyMap
.pnm
P1,P2,P3,P4,P5,P6
Several
Portable Arbitrary Map
.pam
P7
Several
Color Model \ Color Space
The Netpbm format only supports to store the color model but not the actual color space.
Several color spaces are used in practice, for example: BT.709 and sRGB.
As no color space information is available the codec doesn't provide it through its COM interface.
It is up to to displaying application to select the matching color space. For RGB images this is typical sRGB on Windows.
WIC
The Windows Imaging Component (WIC) is a built-in codec framework of Windows that makes it possible
to create independent native image codecs that can be used by a large set of applications.
WIC is implemented using COM technology. Image codecs for many popular formats are already pre-installed on Windows.
Go to the releases page and click on
Assets at the bottom to show the files available in the release.
Please use the appropriate installer that matches your machine's architecture.
> [!NOTE]
> Microsoft Defender SmartScreen may show a warning about an unrecognized app when running the installer. Click on "More Info" + "Run anyway" to continue the installation.
Both the installer and the DLL are signed with a certificate. Defender SmartScreen requires however an EV (Extended Validation) code signing certificate, which is only available to commercial organizations.
Applications that can use the Netpbm WIC codec
The following application have been validated to work with the Netpbm WIC codec:
Windows Explorer Thumbnail cache. This functionality allows Windows Explorer to show previews of images.
Windows Photo Viewer.
Note: On clean installations of Windows 10 this component is installed but not registered. An registry file called restore-windows-photo-viewer.reg
is provided to restore this functionality. The standard Windows Registry Editor can be used to add import this .reg file.
WIC Explorer (sample application from Microsoft). An updated version of this application can be found at
ZackViewer . This viewer can also be used to convert from one image encoding format to another.
Microsoft Office applications like Word, Excel, PowerPoint. These applications can, when the NetPbm codec is installed, import .pgm images in their documents. The 32 bit version of Office
requires that the x86 version of the codec is installed.
Windows 11\10 Microsoft Photos Application not supported
The standard Windows 11\10 Microsoft Photos application cannot be used at this moment as it is limited to the
WIC codecs that are pre-installed on Windows or are provided by Microsoft in the Microsoft Store.
Microsoft currently does not make it possible to create WIC codecs that can be uploaded to the Microsoft Store.
WIC Codec Identity
The following table provides the codec identification information:
The following table lists the GUIDs used to identify the native Netpbm codec components:
Component
GUID
Container Format
70ab66f5-cd48-43a1-aa29-10131b7f4ff1
Decoder Class ID
06891bbe-cc02-4bb2-9cf0-303fc4e668c3
The following table lists the formats that can be decoded:
Magic
Component Count
Bits per Sample
WIC Pixel Format GUID
P5
1
2
GUID_WICPixelFormat2bppGray
P5
1
4
GUID_WICPixelFormat4bppGray
P5
1
8
GUID_WICPixelFormat8bppGray
P5
1
10,12,16*
GUID_WICPixelFormat16bppGray
P6
3
8
GUID_WICPixelFormat24bppRGB
P6
3
16
GUID_WICPixelFormat48bppRGB
P7
4
8
GUID_WICPixelFormat32bppRGBA
Note *: monochrome images with 10 or 12 bits per sample will be upscaled to 16 bits per sample.
Manual Build Instructions
Clone this repro
Use Visual Studio 2022 17.14 or newer and open the netpbm-wic-codec.sln. Batch build all projects.
Or use a Developer Command Prompt and run use MSBuild in the root of the cloned repository.
Installation
Open a command prompt with elevated rights
Navigate to folder with the netpbm-wic-codec.dll
Execute:
regsvr32 netpbm-wic-codec.dll
Uninstall
Open a command prompt with elevated rights
Navigate to folder with the netpbm-wic-codec.dll
Execute:
regsvr32 -u netpbm-wic-codec.dll
Building and code signing
A command file is available to build and sign the WIC DLL and the setup application.
Instructions:
Open a Visual Studio Developer Command Prompt
Go the root of the cloned repository
Ensure a code signing certificate is available
Execute the command create-signed-builds.cmd certificate-thumb-print time-stamp-url
Note: the certificate thumbprint and time stamp URL arguments are depending on the used code signing certificate.
The WIC DLL and the installer will be signed for the release builds of x86, x64 and ARM64.