Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/doc/netpbm/ms/pngtopnm.ms

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TL
Pngtopnm User Manual
.SH 1
pngtopnm
.LP
Updated: 24 March 2005
.br
Table Of Contents
.SH 2
NAME
.LP
pngtopnm - convert a PNG image into a PNM image
.SH 2
SYNOPSIS
.LP
\fBpngtopnm\fR
[\fB-verbose\fR]
[\fB-alpha\fR | \fB-mix\fR]
[\fB-background\fR=\fIcolor\fR]
.br
[\fB-gamma\fR=\fIvalue\fR]
[\fB-text\fR=\fIfilename\fR]
[\fB-time\fR]
[\fIpngfile\fR]
.LP
Minimum unique abbreviation of option is acceptable.  You may use double
hyphens instead of single hyphen to denote options.  You may use white
space in place of the equals sign to separate an option name from its value.
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBpngtopnm\fR reads a PNG image (Portable Network Graphics) as
input and produces a PPM image as output.  The type of the output file
depends on the input file - if it's black & white, \fBpngtopnm\fR
creates a PBM file.  If it's grayscale, \fBpngtopnm\fR creates a PGM
file.  Otherwise, it creates a PPM file.
.SH 2
OPTIONS
.LP
.RS
.IP "\fB-verbose\fR"
Display various information about the input PNG image and the
conversion process.
.LP
If you want even more information about the PNG image, use
\fBpngcheck\fR (not part of Netpbm).
.IP "\fB-alpha\fR"
Output the alpha channel or transparency mask of the image. The
result is either a PBM file or a PGM file, depending on whether
different levels of transparency appear.
.IP "\fB-mix\fR"
Compose the image with the transparency or alpha mask against a
background.  The background color is determined by the bKGD chunk in
the PNG, except that you can override it with \fB-background\fR.
If the PNG has no bKGD chunk and you don't specify \fB-background\fR,
the background color is white.
.IP "\fB-background=\fR\fIcolor\fR"
This option specifies the background color with which to mix the image
when you specify \fB-mix\fR.  
.LP
\fIcolor\fR is as described for the argument of the \fBppm_parsecolor()\fR
library routine.
.LP
Examples:
.IP \(bu
\f(CW-background=rgb:01/ff/80\fR
.IP \(bu
\f(CW-background=rgbi:1/255/128\fR
.LP
.LP
If you don't specify \fB-background\fR, the background color is what
is specified in the PNG image, and if the PNG doesn't specify anything,
white.
.LP
You cannot specify \fB-background\fR unless you also specify
\fB-mix\fR.  Before Netpbm 10.27 (March 2005), you could specify
\fB-background\fR with \fB-mix\fR and it was just ignored.  (This caused
a usability problem).
.IP "\fB-gamma=\fR \fIvalue\fR"
Converts the image to a new display-gamma value.  If a gAMA chunk
is present in the \fIpng-file\fR, \fBpngtopnm\fR uses the specified
image-gamma value.  If not, \fBpngtopnm\fR considers the image-gamma
to be 1.0.  Based on the image-gamma and the display-gamma given with
this option, \fBpngtopnm\fR adjusts the colors written to the
\fIpnm-file\fR.
.LP
Because the gammas of uncompensated monitors are around 2.6, which results 
in an image-gamma of 0.45, some typical situations are: 
when the image-gamma is 0.45 (use -verbose to check) and the picture is too 
light, your system is gamma-corrected, so convert with "-gamma 1.0". 
When no gAMA chunk is present or the image-gamma is 1.0, use 2.2 to make the 
picture lighter and 0.45 to make the picture darker.
.IP "\fB-text=\fR\fIfile\fR"
Writes the tEXt and zTXt chunks to a file, in a format as
described in the \fBpnmtopng\fR user manual.  These chunks contain
text comments or annotations.
.IP "\fB-time\fR"
Prints the tIME chunk to stderr.
.RE
.SH 2
SEE ALSO
.LP
pnmtopng,
\fBptot\fR,
pnmgamma, 
pnm
.LP
For information on the PNG format, see http://schaik.com/png.
.SH 2
NOTE
.LP
.LP
A PNG image contains a lot of information that can't be represented in 
Netpbm formats.  Therefore, you lose information when you convert to 
another format with "pngtopnm | pnmtoxxx".  If there is a specialized 
converter that converts directly to the other format, e.g. \fBptot\fR
to convert from PNG to TIFF, you'll get better results using that.
.SH 2
LIMITATIONS
.LP
There could be an option to read the comment text from pnm comments instead
of a separate file.
.LP
The program could be much faster, with a bit of code optimizing.
As with any Netpbm program, speed always takes a back seat to quick
present and future development.
.SH 2
AUTHORS
.LP
Copyright (C) 1995-1997 by Alexander Lehmann and Willem van Schaik.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
NAME
.IP \(bu
SYNOPSIS
.IP \(bu
DESCRIPTION
.IP \(bu
OPTIONS
.IP \(bu
SEE ALSO
.IP \(bu
NOTE
.IP \(bu
LIMITATIONS
.IP \(bu
AUTHORS
.LP

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.