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

369 lines
9.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of pnmtotiff</TITLE>
</HEAD><BODY>
<H1>pnmtotiff</H1>
Section: User Commands (1)<BR>Updated: 24 January 2001<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>
pnmtotiff - convert a portable anymap into a TIFF file
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>pnmtotiff</B>
[<B>-none</B>|<B>-packbits</B>|<B>-lzw</B>|<B>-g3</B>|<B>-g4</B>]
[<B>-2d</B>]
[<B>-fill</B>]
[<B>-predictor</B>
<I>n</I>]
[<B>-msb2lsb</B>|<B>-lsb2msb</B>]
[<B>-rowsperstrip</B>
<I>n</I>]
[<B>-minisblack</B>|<B>-miniswhite</B>]
[<B>-truecolor</B>]
[<B>-color</B>]
[<B>-indexbits</B>
<I>1|2|4|8</I>]
[<I>pnmfile</I>]
<P>
<P>
Minimum unambiguous abbreviations of options are acceptable.
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Reads a PNM image as input.
Produces a TIFF file as output.
<A NAME="ixAAC"></A>
<P>
The output goes to Standard Output, which must be a seekable file.
That means no pipes, but any regular file should work.
<P>
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<P>
By default,
<B>pnmtotiff</B>
creates a TIFF file with no compression. This is your best bet most
of the time. If you want to try another compression scheme or tweak
some of the other even more obscure output options, there are a number
of flags to play with.
<P>
Actually, the best default would be to use LZW compression, which is
what
<B>pnmtotiff </B>
used to do by default. However, the Tiff library no longer does LZW
compression due to concerns with violating Unisys's patent on LZW
compression.
<P>
The
<B>-none</B>,
<B>-packbits</B>,
<B>-lzw</B>,
<B>-g3</B>,
<B>-g4</B>,
<B>-flate</B>,
and
<B>-adobeflat</B>
options are used to override the default and set the compression
scheme used in creating the output file. The CCITT Group 3 and Group
4 compression algorithms can only be used with bilevel data.
<B>-lzw</B>
doesn't really work because the Tiff library doesn't do LZW
compression. It used to, but its developers removed the function out
of concern about violating Unisys's patent. This option remains in
case you use a Tiff library that cooperates, now or in the future.
The
<B>-2d</B>
and
<B>-fill</B>
options are meaningful only with Group 3 compression:
<B>-2d</B>
requests 2-dimensional encoding, while
<B>-fill</B>
requests that each encoded scanline be zero-filled to a byte boundry.
The
<B>-predictor</B>
option is only meaningful with LZW compression: a predictor value of 2
causes each scanline of the output image to undergo horizontal
differencing before it is encoded; a value of 1 forces each scanline
to be encoded without differencing.
<P>
By default,
<B>pnmtotiff</B>
creates a TIFF file with msb-to-lsb fill order.
The
<B>-msb2lsb</B>
and
<B>-lsb2msb</B>
options are used to override the default and set the fill order used
in creating the file.
<P>
The fill order is the order in which pixels are packed into a byte in
the Tiff raster, in the case that there are multiple pixels per byte.
msb-to-lsb means that the leftmost columns go into the most
significant bits of the byte in the Tiff image. However, there is
considerable confusion about the meaning of fill order. Some believe
it means whether 16 bit sample values in the Tiff image are
little-endian or big-endian. This is totally erroneous (The
endianness of integers in a Tiff image is designated by the image's
magic number). However, ImageMagick and older Netpbm both have been known
to implement that interpretation. 2001.09.06.
<P>
If the image does not have sub-byte pixels, these options have no effect
other than to set the value of the FILLORDER tag in the Tiff image
(which may be useful for those programs that misinterpret the tag with
reference to 16 bit samples).
<P>
<P>
The
<B>-rowsperstrip</B>
option can be used to set the number of rows (scanlines) in each
strip of data in the output file. By default, the output file has
the number of rows per strip set to a value that will ensure each
strip is no more than 8 kilobytes long.
<P>
The
<B>-minisblack</B>
and
<B>-miniswhite</B>
option force the output image to have a &quot;minimum is black&quot;
or &quot;minimum is white&quot; photometric, respectively. If you don't specify either,
<B>pnmtotiff uses minimum is black except</B>
when using Group 3 or Group 4 compression, in which case
<B>pnmtotiff </B>
follows CCITT fax standards and uses &quot;minimum is white.&quot; This usually
results in better compression and is generally preferred for bilevel
coding.
<P>
Before February 2001,
<B>pnmtotiff </B>
always produced &quot;minimum is black,&quot; due to a bug. In either case,
<B>pnmtotiff</B>
sets the photometric interpretation tag in the TIFF output according
to which photometric is actually used.
<P>
<B>-truecolor</B>
tells
<B>pnmtotiff</B>
to produce the 24-bit RGB form of TIFF output if it is producing a
color TIFF image. Without this option,
<B>pnmtotiff</B>
produces a colormapped (paletted) 8-bit TIFF image unless there are more
than 256 colors (and in the latter case, issues a warning).
<P>
The
<B>-truecolor</B>
option can prevent
<B>pnmtotiff</B>
from making two passes through the input file, thus improving speed and
memory usage. See the section MULTIPLE PASSES.
<P>
If
<B>pnmtotiff</B>
produces a grayscale TIFF image, this option has no effect.
<P>
<B>-color</B>
tells
<B>pnmtotiff</B>
to produce a color, as opposed to grayscale, TIFF image if the input is
PPM, even if it contains only shades of gray. Without this option,
<B>pnmtotiff</B>
produces a grayscale TIFF image if the input is PPM and contains only
shades of gray, and at most 256 shades. Otherwise, it produces a color
TIFF output. For PBM and PGM input,
<B>pnmtotiff</B>
always produces grayscale TIFF output and this option has no effect.
<P>
The
<B>-color</B>
option can prevent
<B>pnmtotiff</B>
from making two passes through the input file, thus improving speed and
memory usage. See the section MULTIPLE PASSES.
<P>
The
<B>-indexbits</B>
option is meaningful only for a colormapped (paletted) image. In this kind
of image, the raster contains values which are indexes into a table of
colors, with the indexes normally taking less space that the color
description in the table. pnmtotiff can generate indexes of 1, 2, 4, or 8
bits. By default, it will use 8, because many programs that interpret TIFF
images can't handle any other width.
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
There are myriad variations of the TIFF format, and this program generates
only a few of them.
<B>pnmtotiff</B>
creates a grayscale TIFF file if its input is a PBM (monochrome) or PGM
(grayscale) file.
<B>pnmtotiff</B>
also creates a grayscale file if it input is PPM (color), but there is
only one color in the image. If the input is a PPM (color) file and
there are 256 colors or fewer, but more than 1,
<B>pnmtotiff</B>
generates a color palette TIFF file.
If there are more colors than that,
<B>pnmtotiff</B>
generates an RGB (not RGBA) single plane TIFF file. Use
<B>pnmtotiffcmyk</B>
to generate the cyan-magenta-yellow-black ink color separation TIFF format.
<P>
The number of bits per sample in the TIFF output is determined by the maxval
of the PNM input. If the maxval is less than 256, the bits per sample in
the output is the smallest number that can encode the maxval. If the
maxval is greater than or equal to 256, there are 16 bits per sample in
the output.
<P>
<A NAME="lbAG">&nbsp;</A>
<H3>Multiple Passes</H3>
<P>
<B>pnmtotiff</B>
reads the input image once if it can, and otherwise twice. It needs that
second pass to analyze the colors in the image and generate a color map
(pallette) and determine if the image is grayscale. So the second
pass only happens when the input is PPM. And you can avoid it then by
specifying both the
<B>-truecolor</B>
and
<B>-color</B>
options.
<P>
If the input image is small enough to fit in your system's file cache,
the second pass is very fast. If not, it requires reading from disk
twice, which can be slow.
<P>
When the input is from a file that cannot be rewound and reread,
<B>pnmtotiff</B>
reads the entire input image into a temporary file which can, and works
from that. Even if it only needs one pass.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+tifftopnm">tifftopnm</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmtotiffcmyk">pnmtotiffcmyk</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmdepth">pnmdepth</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+pnm">pnm</A></B>(5)
<P>
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHOR</H2>
Derived by Jef Poskanzer from ras2tiff.c, which is
Copyright (c) 1990 by Sun Microsystems, Inc.
Author: Patrick J. Naughton (<A HREF="mailto:naughton@wind.sun.com">naughton@wind.sun.com</A>).
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="5"><A HREF="#lbAF">NOTES</A><DD>
<DL>
<DT id="6"><A HREF="#lbAG">Multiple Passes</A><DD>
</DL>
<DT id="7"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="8"><A HREF="#lbAI">AUTHOR</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>