Science Fair Projects Ideas - Portable Pixmap file format

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Portable Pixmap file format

The portable pixmap / greymap / bitmap file formats (PPM, PGM, PBM) are file formats for exchanging graphics files. They are very basic and serve as a least common denominator for converting pixmap, greymap , or bitmap files between different platforms. They are used under the collective name PNM format in the Netpbm file conversion package.

Let's take the example of the letter J from the bitmap article

....X.
....X.
....X.
....X.
....X.
....X.
X...X.
.XXX..
......
......

It is represented in the most basic (monochrome) PBM format as follows

P1
# This is an example bit map file j.pbm
6 10
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
1 0 0 0 1 0
0 1 1 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0

The P1 is the identificaton of the file format. The hash sign marks a commentary. And the next two numbers give the width and the height. Then follows the matrix with the pixel values (in the monochrome case here only zeros and ones).

This file can be converted by two conversion programs from the Netpbm package for example to a bmp file:

pgmtoppm "#FFFFFF" j.pbm  > j.ppm
ppmtobmp j.ppm > j.bmp

Depending on the identification of the file format three similar file formats are distinguished, each with two versions:

  • pbm - portable bitmap file format (P1/P4) - 1 bit per pixel
  • pgm - portable graymap file format (P2/P5) - 8 bits per pixel
  • ppm - portable pixmap file format (P3/P6) - 24 bits per pixel, 8 for red, 8 for green, 8 for blue

In each case, the lower-numbered version refers to a human-readable, ASCII-based format similar to the one in the example above and the higher-numbered version refers to a binary format which is not human-readable but saves some space in the file, as well as being easier to parse due to the lack of whitespace.

External link

Last updated: 05-16-2005 01:59:58
11-30-2008 18:11:33
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice