Portable PixMap Importer / Exporter - v2.0,  © 2004 Richard Rosenman Advertising & Design. Release date: 11/03/03, Updated 12/13/03.


INSTALLATION:

Simply unzip "pixmap.zip" and copy "pixmap.8bf" to your "\Photoshop\Plug-Ins\" folder, or whichever plugin folder your host program uses. Load your program, open an image, go to the plugins menu and select the plugin.


DESCRIPTION:

This filter imports and exports 8/16 bit Portable PixMap (PPM, PGM, PBM) images.

The PPM / PGM / PBM file format is a convenient image file format which allows one to save an image in ASCII or BINARY mode. Because ASCII is simple text, it allows anyone to easily import these images into one's own applications. It also allows one to open the ASCII file in any text editor and make changes if desired. ASCII images are text based and therefore large and slow loading. BINARY images are smaller and faster loading but are not text based.

To use this filter, you must be in either 8 bit RGB mode, 16 bit RGB mode or 16 bit Grayscale mode. This means that if you wish to save an 8 bit greyscale image (PGM), you should convert your image to greyscale and then switch back to 8 bit RGB mode to run the filter. When saving greyscale PGM's, the filter will only save the red channel of the image. Since all channels have since been converted to greyscale, they all equal the same value.

If you wish to save a bitmap (black & white) image (PBM), you should convert your image to a bitmap (bitmap mode) and then switch back to 8 bit RGB mode to run the filter. When saving bitmap PBM's, the filter will only save the red channel of the image. Since all channels have since been converted to black and white, they all equal the same value.

The same principle applies to loading color, greyscale or bitmap images. Simply load them in 8 bit RGB mode and then switch to the appropriate image mode (RGB, GREYSCALE, BITMAP).

Portable PixMap Importer/Exporter 2.0 now supports 16 bit RGB and Grayscale images. To save a 16 bit RGB image, simply switch to 16 bit RGB mode and run the filter. You will notice that you can only save in ASCII mode, and only in RGB. This is because BINARY exporting is currently not supported for 16 bit RGB images. To save a 16 bit Grayscale image, simply switch to 16 bit Grayscale mode and run the filter. You will notice that you can only save in ASCII mode, and only in Grayscale. This is because BINARY exporting is currently not supported for 16 bit Grayscale images.

If you attempt to import a 16 bit RGB or Grayscale image but are not currently in the appropriate 16 bit mode, you will be asked to switch to that mode and try again. Likewise, if you attempt to import an 8 bit RGB or Grayscale image but are not currently in the appropriate 8 bit mode, you will be asked to switch to that mode and try again.  

LOAD PPM, PGM, PBM: Selecting this and applying OK will prompt you to select an ASCII or BINARY PPM, PGM or PBM file to import.

Show File Comments: If selected, this will display any comments contained in the imported file.

SAVE PPM, PGM, PBM: Selecting this and applying OK will prompt you to select a PPM, PGM or PBM filename to export.

Save in ASCII. This will save the PPM, PGM or PBM file in ASCII format.

Save in BINARY. This will save the PPM or PGM file in BINARY format. PBM's cannot be saved in BINARY mode.


COMPATIBILITY:

While Portable PixMap Importer / Exporter cannot guarantee 100% compatibility with all PPM, PGM, PBM images, it has been tested with the following software:

Images exported with Portable PixMap Importer / Exporter are compatible with ACDSee 3.1.

Images exported with Portable PixMap Importer / Exporter are compatible with IrfanView 3.85.

Images exported with Portable PixMap Importer / Exporter (in BINARY only) are compatible with HDRShop 1.0.3.

Images exported with Portable PixMap Importer / Exporter (8/16 bit) are compatible with Bryce 5.0

Images exported with IrfanView 3.85 are compatible with Portable PixMap Importer / Exporter.

Images exported with XV Version 3.10a are compatible with Portable PixMap Importer / Exporter.

Images exported with The GIMP's PNM Filter Version 1.0 are compatible with Portable PixMap Importer / Exporter.

Images exported with HDRShop 1.0.3 are compatible with Portable PixMap Importer / Exporter.

Images exported with Bryce 5.0 are compatible with Portable PixMap Importer / Exporter.

And of course, any images exported with Portable PixMap Importer / Exporter are compatible with Portable PixMap Importer / Exporter.

There are probably many more compatible applications that haven't been formally tested but in most cases, it should work.


PORTABLE PIXMAP FILE STRUCTURE:

It is important to understand the Portable PixMap file structure as it is often possible to make an incompatible image compatible by adjusting an incorrect variable. A Portable PixMap Image file contains the following file structure:

P3		- The magic number. "P3" = ASCII color, "P6" = BINARY color, "P2" = ASCII greyscale, "P5" = BINARY greyscale, "P1" = ASCII bitmap (black and white).

# A Comment	- Comments preceded by the character "#". Any number of lines at this point can be commented.

640 480		- Horizontal and vertical image resolution. Separated by a space.

255		- Maximum value of the color component. Usually "255" for 8 bit images, "65535" for 16 bit images.

0 0 0 255 128 0 - RGB, greyscale, or black and white information. Read in order of Red, Green then Blue. If RGB, there will be a red, green and blue integer. If greyscale, there will be a greyscale integer. If bitmap, there will be either "0" (white) or "1" (black).

Note that the lines should not be longer than 70 characters.

As an example, a typical color ASCII PPM would have the following file structure:

P3
# Example
4 4
50
 0  0  0    0  0  0    0  0  0   50  0 50
 0  0  0    0 50  7    0  0  0    0  0  0
 0  0  0    0  0  0    0 50  7    0  0  0
50  0 50    0  0  0    0  0  0    0  0  0


KNOWN BUGS:

None


FIXES:

1.1 - Fixed a bug which sometimes did not properly import binary PPM and PGM images.
2.0 - Added 16 bit RGB and Grayscale import / export support.

HOMEPAGE:

http://www.richardrosenman.com
