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

107 lines
2.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of pnmscalefixed</TITLE>
</HEAD><BODY>
<H1>pnmscalefixed</H1>
Section: User Commands (1)<BR>Updated: 18 November 2000<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="ixAAB"></A>
<A NAME="ixAAC"></A>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
pnmscalefixed - scale a portable anymap quickly, but less accurate
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>pnmscalefixed</B>
is the same thing as
<B>pnmscale</B>
except that it uses fixed point arithmetic internally instead of
floating point, which makes it run faster. In turn, it is less
accurate and may distort the image.
<P>
Use the
<B>pnmscale</B>
man page with
<B>pnmscalefixed</B>.
This man page only describes the difference.
<P>
<B>pnmscalefixed</B>
uses fixed point 12 bit arithmetic. By contrast,
<B>pnmscale</B>
uses floating point arithmetic which on most machines is probably 24 bit
precision. This makes
<B>pnmscalefixed</B>
run faster (30% faster in one experiment), but the imprecision
can cause distortions at the right and bottom edges.
<P>
The distortion takes the following form: One pixel from the edge of
the input is rendered larger in the output than the scaling factor
requires. Consequently, the rest of the image is smaller than the
scaling factor requires, because the overall dimensions of the image
are always as requested. This distortion will usually be very hard
to see.
<P>
<B>pnmscalefixed</B>
with the
<B>-verbose</B>
option tells you how much distortion there is.
<P>
The amount of distortion depends on the size of the input image and how
close the scaling factor is to an integral 1/4096th.
<P>
If the scaling factor is an exact multiple of 1/4096, there is no
distortion. So, for example doubling or halving an image causes no
distortion. But reducing it or enlarging it by a third would cause
some distortion. To consider an extreme case, scaling a 100,000 row
image down to 50,022 rows would create an output image with all of the
input squeezed into the top 50,000 rows, and the last row of the input
copied into the bottom 22 rows of output.
<P>
<B>pnmscalefixed</B>
could probably be modified to use 16 bit or better arithmetic without
losing anything. The modification would consist of a single constant
in the source code. Until there is a demonstrated need for that,
though, the Netpbm maintainer wants to keep the safety cushion
afforded by the original 12 bit precision.
<P>
<P>
<B>pnmscalefixed</B>
does not have
<B>pnmscale 's</B>
<B>-nomix</B>
option.
<P>
<P>
<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">DESCRIPTION</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>