man-pages/man1/pnmtopng.1.html
2021-03-31 01:06:50 +01:00

303 lines
7.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of pnmtopng</TITLE>
</HEAD><BODY>
<H1>pnmtopng</H1>
Section: User Commands (1)<BR>Updated: 6 January 1997<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="ixAAB"></A>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
pnmtopng - convert a portable anymap into a Portable Network Graphics file
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>pnmtopng</B>
[-verbose]
[-downscale]
[-interlace]
[-alpha file]
<BR>
[-transparent [=]color]
[-background color]
[-gamma value]
<BR>
[-hist]
[-chroma wx wy rx ry gx gy bx by]
[-phys x y unit]
<BR>
[-text file]
[-ztxt file]
[-time [yy]yy-mm-dd hh:mm:ss]
<BR>
[-filter type]
[-compression level]
[-force]
[<I>pnmfile</I>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Reads a portable pixmap as input.
Produces a Portable Network Graphics file as output.
<A NAME="ixAAC"></A>
<P>
Color values in PNG files are either eight or sixteen bits wide, so
<I>pnmtopng</I>
will automatically scale colors to have a maxval of 255 or 65535.
Grayscale files will be produced with bit depths 1, 2, 4, 8 or 16.
An extra
<I>pnmdepth</I>
step is not necessary.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-verbose</B>
<DD>
Display the format of the output file.
<DT id="2"><B>-downscale</B>
<DD>
Enables scaling of maxvalues of more then 65535 to 16 bit. Since this means
loss of image data, the step is not performed by default.
<DT id="3"><B>-interlace</B>
<DD>
Creates an interlaced PNG file (Adam7).
<DT id="4"><B>-alpha file</B>
<DD>
The alpha channel of pixel (or image) specifies the transparency of a pixel.
To create this fourth pixel value a separate
<I>.pbm-</I>
or
<I>.pgm-file</I>
is needed. In this file black (0) stands for fully transparant and white (1)
will become opaque. The sizes of both pbm/pgm/ppm-files must be the same.
If the information contained in the alpha mask can also be represented as
a transparency index, it will be used, since this should result in a smaller
image file.
<DT id="5"><B>-transparent color</B>
<DD>
<B>ppmtogif</B>
marks the specified color as transparent in the PNG image.
<P>
You specify the color as in
<B><A HREF="/cgi-bin/man/man2html?1+ppmmake">ppmmake</A></B>(1).<B>E.g.</B>
<B>red</B>
or
<B>rgb:ff/00/0d</B>.
If the color you specify is not present in the image,
<B>pnmtopnm</B>
selects instead the color in the image that is closest to the one you
specify. Closeness is measured as a cartesian distance between colors
in RGB space. If multiple colors are equidistant,
<B>pnmtopnm</B>
chooses one of them arbitrarily.
<P>
However, if you prefix your color specification with &quot;=&quot;, e.g.
<P>
<B>-transparent =red</B>
<P>
Only the exact color you specify will be transparent. If that color does
not appear in the image, there will be no transparency.
<B>pnmtopng</B>
issues an information message when this is the case.
<P>
<P>
<DT id="6"><B>-background color</B>
<DD>
To create a background color chunck in the
<I>png-file,</I>
which can be used for subsequent alpha-channel or transparent-color
conversions. See -transparent for format of color.
<DT id="7"><B>-gamma value</B>
<DD>
Creates an gAMA chunk. By providing the gamma-value of the
<I>pnm-file</I>
the software that lateron will display the
<I>png-file</I>
will be able to do the necessary gamma-corrections. A good rule-of-thumb is
that when the file is created by a software program (like a CAD-program or
a ray-tracer) the value is probably 1.0. When the
<I>pnm-file</I>
looks good on a non-gamma corrected PC display (which has itself a gamma-value
of 2.2 - 2.8), a value of 0.45 should be given.
<DT id="8"><B>-hist</B>
<DD>
Use this parameter to create a chunk that specifies the frequency (or histogram)
of the colors in the image.
<DT id="9"><B>-chroma white point X and Y, red X and Y, green X and Y, and blue X and Y</B>
<DD>
To specify the white point and rgb values following the CIE-1931 spec.
<DT id="10"><B>-phys x y unit</B>
<DD>
When your image should not be displayed with square but with rectangular
pixels this option should be used to create a pHYS chunk. When the unit-value
is 0 the x and y only gives the ratio of pixel width and height. When it is
1 the x and y specify the number of pixels per meter.
<DT id="11"><B>-text file</B>
<DD>
Allows to include comments in the text-chunk of the
<I>png-file.</I>
The format of the text-file is as follows: when the first column does not
contain a blank or a tab, the first word is considered to be the keyword.
For keywords to contain spaces, enclose them in double-quotes.
<BR>
When the first character on a line is a blank or tab, the rest of the line
is a new line of the current comment.
Note that the initial spaces are not considered to be part of the comment
line.
<BR>
<P>
<BR>
Here is an example:
<BR>
-------------------------------------------
<BR>
Title PNG-file
<BR>
Author your name
<BR>
Description how to include a text-chunk
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;into&nbsp;a&nbsp;PNG&nbsp;file
<BR>
&quot;Creation date&quot; 3-feb-1987
<BR>
Software pnmtopng
<BR>
-------------------------------------------
<DT id="12"><B>-ztxt file</B>
<DD>
The same as -text, but now the text will be compressed.
<DT id="13"><B>-time yy-mm-dd hh:mm:ss or -time yyyy-mm-dd hh:mm:ss</B>
<DD>
This option allows you to specify the (modification)time. The year parameter
can be given as a two- or a four-digit value.
<DT id="14"><B>-filter type</B>
<DD>
When the types of filters must be restricted you can specify here
which filter you want to use. Allowed values are: 0 (none), 1 (sub),
2 (up), 3 (avg) and 4 (paeth).
<DT id="15"><B>-compression level</B>
<DD>
To explicitly set the compression level of zlib use this parameter. Select
a level between 0 for no compression (max speed) and 9 for maximum compression.
<DT id="16"><B>-force</B>
<DD>
When set, -force limits the optimizations of pnmtopng. A png-file similar
to the pnm-input is as much as possible enforced. For example no paletted
files will be created and alpha-channel images will not be converted to
images with a transparency chunck.
</DL>
<P>
All flags can be abbreviated to their shortest unique prefix.
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<A HREF="/cgi-bin/man/man2html?1+pngtopnm">pngtopnm</A>(1), <A HREF="/cgi-bin/man/man2html?1+gif2png">gif2png</A>(1), <A HREF="/cgi-bin/man/man2html?1+pnmgamma">pnmgamma</A>(1), <A HREF="/cgi-bin/man/man2html?5+pnm">pnm</A>(5)
<A NAME="lbAG">&nbsp;</A>
<H2>NOTE</H2>
Instead of xxxtopnm|pnmtopng, a specific converter should be used, if
available.
E.g.
<I>gif2png</I>
(GIF conversion), etc.
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>
There could be an option to read the comment text from pnm comments instead
of a separate file.
<P>
The program could be much faster, with a bit of code optimizing.
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHORS</H2>
Copyright (C) 1995-1997 by Alexander Lehmann
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;Willem&nbsp;van&nbsp;Schaik.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="17"><A HREF="#lbAB">NAME</A><DD>
<DT id="18"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="19"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="20"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="21"><A HREF="#lbAF">SEE ALSO</A><DD>
<DT id="22"><A HREF="#lbAG">NOTE</A><DD>
<DT id="23"><A HREF="#lbAH">BUGS</A><DD>
<DT id="24"><A HREF="#lbAI">AUTHORS</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:24 GMT, March 31, 2021
</BODY>
</HTML>