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