| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Ppmtopgm User Manual" 1 "25 June 2017" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
|
| 10 |
ppmtopgm - convert a PPM image to a PGM image |
| 11 |
|
| 12 |
.UN synopsis |
| 13 |
.SH SYNOPSIS |
| 14 |
|
| 15 |
\fBppmtopgm\fP |
| 16 |
|
| 17 |
[\fIppmfile\fP] |
| 18 |
|
| 19 |
.UN description |
| 20 |
.SH DESCRIPTION |
| 21 |
.PP |
| 22 |
This program is part of |
| 23 |
.BR "Netpbm" (1)\c |
| 24 |
\&. |
| 25 |
.PP |
| 26 |
\fBppmtopgm\fP reads a PPM as input and produces a PGM as output. |
| 27 |
The output is a "black and white" rendering of the original |
| 28 |
image, as in a black and white photograph. The quantization formula |
| 29 |
\fBppmtopgm\fP uses is y = .299 r + .587 g + .114 b. |
| 30 |
.PP |
| 31 |
The dimensions and maxval of the output are the same as the input. |
| 32 |
Note that with only one color plane, there are far fewer brightnesses |
| 33 |
that can be represented with the same maxval than with three color |
| 34 |
planes, so you may want to increase the maxval of the input with |
| 35 |
\fBpamdepth\fP before giving it to \fBppmtopgm\fP to avoid loss of |
| 36 |
information. For example, with a maxval of 1, there are 8 brightnesses that |
| 37 |
are possible in a PPM (though some of them are barely distinguishable), but |
| 38 |
only 2 brightness levels possible in a PGM. |
| 39 |
.PP |
| 40 |
Note that although there is a \fBpgmtoppm\fP program, it is not |
| 41 |
necessary for simple conversions from pgm to ppm , because any ppm |
| 42 |
program can read pgm (and pbm ) files automatically. \fBpgmtoppm\fP |
| 43 |
is for colorizing a pgm file. Also, see \fBppmtorgb3\fP for a |
| 44 |
different way of converting color to gray. And \fBppmdist\fP |
| 45 |
generates a grayscale image from a color image, but in a way that |
| 46 |
makes it easy to differentiate the original colors, not necessarily a |
| 47 |
way that looks like a black and white photograph. |
| 48 |
|
| 49 |
.UN options |
| 50 |
.SH OPTIONS |
| 51 |
.PP |
| 52 |
There are no command line options defined specifically |
| 53 |
for \fBppmtopgm\fP, but it recognizes the options common to all |
| 54 |
programs based on libnetpbm (See |
| 55 |
.UR index.html#commonoptions |
| 56 |
Common Options |
| 57 |
.UE |
| 58 |
\&.) |
| 59 |
|
| 60 |
.UN quote |
| 61 |
.SH QUOTE |
| 62 |
|
| 63 |
.nf |
| 64 |
Cold-hearted orb that rules the night |
| 65 |
Removes the colors from our sight |
| 66 |
Red is gray, and yellow white |
| 67 |
But we decide which is right |
| 68 |
And which is a quantization error. |
| 69 |
|
| 70 |
.fi |
| 71 |
|
| 72 |
.UN seealso |
| 73 |
.SH SEE ALSO |
| 74 |
.BR "pgmtoppm" (1)\c |
| 75 |
\&, |
| 76 |
.BR "ppmtorgb3" (1)\c |
| 77 |
\&, |
| 78 |
.BR "rgb3toppm" (1)\c |
| 79 |
\&, |
| 80 |
.BR "ppmdist" (1)\c |
| 81 |
\&, |
| 82 |
.BR "ppm" (1)\c |
| 83 |
\&, |
| 84 |
.BR "pgm" (1)\c |
| 85 |
\& |
| 86 |
|
| 87 |
.UN author |
| 88 |
.SH AUTHOR |
| 89 |
|
| 90 |
Copyright (C) 1989 by Jef Poskanzer. |
| 91 |
.SH DOCUMENT SOURCE |
| 92 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 93 |
source. The master documentation is at |
| 94 |
.IP |
| 95 |
.B http://netpbm.sourceforge.net/doc/ppmtopgm.html |
| 96 |
.PP |