Jump to content
How to Install Plugins ×

'Portable Anymap' FileType Plugin (.PAM, .PBM, .PGM, .PPM)


midora

Recommended Posts

 

'Portable Anymap' FileType Plugin (.PAM, .PBM, .PGM, .PPM)

Summary

Paint.NET FileType plugin which loads and saves image files in one of the PNM (Portable Anymap) file formats:

  • PAM - Portable Arbitrary Map (Black and White, Grayscale, RGB; Alpha channel; raw only; up to 16bits per channel)
  • PBM - Portable Bit Map: (Black and White; plain and raw)
  • PGM - Portable Gray Map: (Grayscale; plain and raw; up to 16bits per channel)
  • PPM - Portable Pixel Map: (RGB; plain and raw; up to 16bits per channel)

These are quite old image formats used mainly in the academic area. They do not support any kind of packing the pixels. For more information see 'The Netpbm Formats'

Author

Martin Osieka

Download

Find the latest version of the plugin ImPNM.FileType v1.1 (19.2.2015) here.

Installation

Follow the instructions carefully

  • Copy the file ImPNM.FileType.dll to the Paint.NET\FileTypes\ folder
  • Remove other plugins supporting the same file types (.pam, .pbm, .pgm, .ppm) from Paint.NET\FileTypes\ folder (to avoid possible conflicts) I.e. 'PNMPlugin.dll' plugin.
  • After a restart of Paint.NET you will find the plugin in the 'Save as type' selector of the 'Save' and 'Save As' dialog. 'Load' does not use a dialog.

Compatibility

Paint.NET 3.5.11 and 4.0.5

Supported languages

  • English

Dialog options

Save as .PAM dialog options

 

     ImPNM.FileType.Dialog-PAM.jpg

  • Output color model selector
    You may choose between: RGB+Alpha, RGB, Gray+Alpha, Gray, Black and White + Alpha, and Black and White. Because the internal color model of Paint.NET is RGB+Alpha the plugin has to convert the existing image data if you are choosing a different output model.
    • RGB+Alpha: Outputs RGB + A.
    • RGB: Blends the image against the background color (w/o effect if the image is opaque). Outputs RGB.
    • Gray+Alpha: Calculates gray values from RGB values. Outputs G + A.
    • Gray: Blends the image against the background color (w/o effect if the image is opaque) and calculates gray values from the resulting RGB values. Outputs G.
    • Black and White + Alpha: Calculates gray values from RGB values. Converts Gray to BW. Outputs BW + A.
    • Black and White: Blends the image against the background color (w/o effect if the image is opaque) and calculates gray values from the resulting RGB values. Converts Gray values to BW values. Outputs BW.
  • 'Maximum value in channel' numeric control
    In Paint.NET the maximum value in all channels (R, G, B, and A) is 255. This control allows you to use any value between 1 and 65535. The formula to map the channel values is
       dstValue = (srcValue * maxValue + 127) / 255
    For sure if you are scaling the value up then you will not get more details in the picture. No magic.
    The maximum value used by 'Black and White' is always 1.
  • Background color selector
    This color is used if one of the color models w/o alpha is selected.

Save as .PBM, .PGM, and .PPM dialog options


There is only one difference against the .PAM dialog. Instead of the color model (which is fix by the file type) you are able to select between a raw (binary) and a plain (Ascii text) mode.

Known issues

  • The color wheel control used to set the background color does not match the size available in the dialog. It looks somehow OK in Paint.NET 3.5.11 but not quite good in Paint.NET 4.0 BETA. Maybe this will change in a later version of Paint.NET.

To Do list

  • Optimize for speed

Examples

Paint.NET forum logo in PAM format.zip

History

  • 1.1 (19.2.2015)
    Fixes the issue that the plugin opens the web page of the plugin w/o a request of the user.
  • 1.0 (27.2.2014)
    First public release
Edited by midora
Added link to zipped DLL

midoras signature.gif

Link to comment
Share on other sites

I don't know that I have a use for the format, but I appreciate the effort you've put into creating this - especially since the previous version here is showing some issues with v4.0.

 

Thanks!

Link to comment
Share on other sites

Just out of the box because the old one has issues in 4.0 and was never complete. So I did this one some time ago.

Used nowadays to allow data analysis with some special plugins.

The PAM format allows more than 4 channels so you can easliy store additional parts of the spectrum.

midoras signature.gif

Link to comment
Share on other sites

  • 10 months later...

Hi,

every time I want to save a pgm image in Paint.NET, this website open just after the "Save Configuration" dialog appears, undemanded. It just opens that website in my browser, although I didn't click any buttons or so.

This is very annoying. Can you fix it or forward this to the developers of this plugin? I couldn't register in their forum, and found no contact details.

Link to comment
Share on other sites

Martin Oseika is the developer of this plugin. The website which opens is where you can download his other plugins.

I can understand the irritation. I'm sure Martin will sort this out as soon as he has time.

Link to comment
Share on other sites

Hi,

every time I want to save a pgm image in Paint.NET, this website open just after the "Save Configuration" dialog appears, undemanded. It just opens that website in my browser, although I didn't click any buttons or so.

This is very annoying. Can you fix it or forward this to the developers of this plugin? I couldn't register in their forum, and found no contact details.

 

Should not happen for sure but you may get in a state that it will happen (so I'm able to reproduce it).

There is no easy fix in the code but a solution to get rid of your issue:

 

- Open Paint.NET

- Save the 'Untitled' image somewhere as PGM

- If the Save dialog is open then click the defaults button.

- Click OK (so the file will be created).

- Close Paint.NET.

- Remove the Untitled.pgm

 

You may skip the following details ;-)

The problem is that buttons are counters in IndirectUI. To check if a button is clicked you have to compare the current value with the previous one. Filetype plugins (not Effect plugins) remember the settings of the dialog in the registry. In case of a button this is the incremented value. So if you once clicked the button and restarted Paint.NET later then the values will be different and the plugin thinks that the button has been clicked.

 

Sorry that you may not get an answer on the forum but we are fighting with hundreds of spam users a day. You may use an IP which will not get a response.

Edited by midora

midoras signature.gif

Link to comment
Share on other sites

That solved the issue. Thanks.

Indeed, I could have clicked that button a while ago.

(Note to myself: Never click any buttons in Paint.Net plugins unless it's absolutely necessary. ;) )

Edited by mario77
Link to comment
Share on other sites

  • 4 weeks later...

Does anyone have a copy of v1.1 zipped?

Link to comment
Share on other sites

  • 4 months later...

Thanks Stan. File added to first post.

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.

Guest
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...