Subject: Re: format of raw file created from 'pnmtoraw'

From: [email-masked] ()
Date: 12 Jul 94 19:33:30 GMT

[email-masked] (Dennis Graham 'InterNaut') writes:

>	Can anybody give a brief explanation of the format of the
>raw file produced by 'pnmtoraw'?  I tried to read the raw file in and
                      ^^^^^^^^^^

I guess you mean the "rawtopgm", because I don't have "pnmtoraw"
but "pnmnoraw" which does a conversion of 

	P1 -> P4 (pbm)
	P2 -> P5 (pgm)
	P3 -> P6 (ppm)

>rotate it, but apparently, I am confused about the format.

>	In the header info, I see the following:

>	P5
>	x_width y_height
>	grey_scale_range

>	Now, I just assumed that I could read the width and height
>and that the data is simply formatted as a stream from the upper-left
>corner to the bottom-right corner.  Am I incorrect in this assumption?

I guess so too.  I have just tried the "rawtopgm" with a text file;

	rawtopgm 256 256 mpeg.faq > raw.pgm

And you get an output only a pgm-header more than the original file
and the rest is discarded.  Using "pgmhist" one can even examine the 
relative frequency of alphabet in English texts.  I saw a large peak 
at "space"(32) and an "English-Distribuion" on the right side of
MPEG.FAQ.  Displaying the output in this case is something like

	cat mpeg.faq > /dev/audio

I don't know when do we need to use "rawtopgm" and "rawtoppm"?

--
|------------------------------------------------------------------------|
  Nan-shan Chen                    Vogeliusweg 19.4.0.3, 33100 Paderborn
  [email-masked]     [email-masked]   
  private: [email-masked]    51 43 1.72 N / 08 45 49.29 E
|------------------------------------------------------------------------|