Jump to content
How to Install Plugins ×

PNM File Type Plugin


Recommended Posts

The FileType Plugin to read and write PNM Images


MODERATORS NOTE:  This effect is incompatible with Paint.NET 4.0x


PNM File Types
PNM is a portable bitmap format used in legacy software. The use of PNM file format is more common in LINUX / UNIX Platform. PNM file format consists of three different file formats namely PBM, PGM and PPM. (Corrections suggested by Andrew Kirillov, thank you.)

PBM [Portable Bit Map - Binary]
PGM [Portable Grey Map - GreyScale]
PPM [Portable Pixel Map - Color]

Each of these file formats can be written in ASCII or Binary Encoding. The encoding is determined at reading time against the Identifier each PNM file contains called "Magic Number". This is always the first token of the PNM file.

"P1" [PBM - ASCII Encoding]
"P2" [PGM - ASCII Encoding]
"P3" [PPM - ASCII Encoding]
"P4" [PBM - Binary Encoding] (not yet implemented)
"P5" [PGM - Binary Encoding]
"P6" [PPM - Binary Encoding]

16-bit Extensions
The original definitions of PGM and PNM do not describe 16-bit pixel formats. It has, however been used in many practical situations where accuracy/depth of color information matters. This plugin does not currently support the 16-bit extensions.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 year later...

This is exactly what I was looking for. I like to write ray tracers, and PPM is a brain dead way to dump an image into disk.

One bug that I noticed though is that it seems like the red and blue channels are swapped when loading (but not when saving). I tested this with a third party PPM viewer to make sure (just in case there was a bug in my code).

Means that if I want to load my images into Paint.NET I actually have to swap my red and blue channels as I am saving so when I load it everything will appear as expected.

Link to comment
Share on other sites

  • 5 months later...

Since I have the same issue, I have try to correct it.

I have used the original plugin, reverse it to made a correction.

So I have corrected : PPM P6 format (binary format only, and the size of the combobox when saving an image.

Hope it will help somebody.

Link to comment
Share on other sites

Thanks for the update dfleury.

Can you please remove your earlier versions of the plugin (i.e. edit your post to remove the attachment), leaving just the latest version. Thanks.

I'll edit the original post to include your update if someone who uses the filetype can give it a thorough testing for me.

Any takers?

Link to comment
Share on other sites

  • 1 month later...

/filetypes/ folder. It's definitely a filetype plugin.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...