PAM graphics format
Encyclopedia
The PAM graphics format of the Netpbm
Netpbm
Netpbm is an open source package of graphics programs and a programming library, used mainly in the Unix world. It is a highly portable package, working under many Unix platforms, Windows, Mac OS X, VMS, Amiga OS and others and is included in all major open source Unix-like operating system...

 package generalises all the features of the previous formats (PBM, PGM and PPM) and provides for extending them. As well as width, height and maximum value, which are found in the older formats, PAM defines two new attributes: depth and tuple type.

The depth attribute defines the number of channels in the image, such as 1 for greyscale images and 3 for RGB images. The tuple type attribute specifies what kind of image the PAM file represents, thus enabling it to stand for the older Netpbm formats, as well as to be extended to new uses. For example, an image with a tuple type of GRAYSCALE is equivalent to PGM (portable graymap).

Fundamental differences from the older formats

The header for the PAM file format begins with P7, and (unlike in the other formats) ends in an explicit close: ENDHDR.

There is no plain (human-readable, ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

-based) version of PAM. PAM files are always binary, and attempts to use the switch -plain with Netpbm programs that produce PAM output results in an error message.

For the black-and-white version of PAM (depth 1, tuple type BLACKANDWHITE), corresponding to PBM, PAM uses one byte per pixel, instead of PBM’s use of one bit per pixel (packing eight pixels in one byte). Also, the value 1 in such a PAM image stands for white (“light on”), as opposed to black in PBM (“ink on”).

Transparency

All of the basic tuple types (BLACKANDWHITE, GRAYSCALE, and RGB) have a variant with an opacity channel
Alpha compositing
In computer graphics, alpha compositing is the process of combining an image with a background to create the appearance of partial or full transparency. It is often useful to render image elements in separate passes, and then combine the resulting multiple 2D images into a single, final image in a...

. The tuple type is created by appending "_ALPHA" as a suffix to the base tuple type. For example tuple type RGB_ALPHA (with depth 4) serves for RGBA
RGBA color space
RGBA stands for Red Green Blue Alpha. While it is sometimes described as a color space, it is actually simply a use of the RGB color model, with extra information. The color is RGB, and may belong to any RGB color space, but an integral alpha value as invented by Catmull and Smith between 1971 and...

images, which previously required the use of a separate PGM image for the opacity channel.

Extensions

PAM's tuple-type mechanism allows for many extensions. In theory, PAM can be extended to represent colour models like CMYK, and even non-graphical information arrays.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK