1Pnmscalefixed User Manual(0) Pnmscalefixed User Manual(0)
2
3
4
6 pnmscale - scale a PNM file quickly
7
8
10 This program is part of Netpbm(1).
11
12 pnmscalefixed is the same thing as pnmscale except that it uses fixed
13 point arithmetic internally instead of floating point, which makes it
14 run faster. In turn, it is less accurate and may distort the image.
15
16 Use the pnmscale user manual with pnmscalefixed. This document only
17 describes the difference.
18
19 pnmscalefixed uses fixed point 12 bit arithmetic. By contrast, pnm‐
20 scale uses floating point arithmetic which on most machines is probably
21 24 bit precision. This makes pnmscalefixed run faster (30% faster in
22 one experiment), but the imprecision can cause distortions at the right
23 and bottom edges.
24
25 The distortion takes the following form: One pixel from the edge of the
26 input is rendered larger in the output than the scaling factor
27 requires. Consequently, the rest of the image is smaller than the
28 scaling factor requires, because the overall dimensions of the image
29 are always as requested. This distortion will usually be very hard to
30 see.
31
32 pnmscalefixed with the -verbose option tells you how much distortion
33 there is.
34
35 The amount of distortion depends on the size of the input image and how
36 close the scaling factor is to an integral 1/4096th.
37
38 If the scaling factor is an exact multiple of 1/4096, there is no dis‐
39 tortion. So, for example doubling or halving an image causes no dis‐
40 tortion. But reducing it or enlarging it by a third would cause some
41 distortion. To consider an extreme case, scaling a 100,000 row image
42 down to 50,022 rows would create an output image with all of the input
43 squeezed into the top 50,000 rows, and the last row of the input copied
44 into the bottom 22 rows of output.
45
46 pnmscalefixed could probably be modified to use 16 bit or better arith‐
47 metic without losing anything. The modification would consist of a
48 single constant in the source code. Until there is a demonstrated need
49 for that, though, the Netpbm maintainer wants to keep the safety cush‐
50 ion afforded by the original 12 bit precision.
51
52 pnmscalefixed does not have pnmscale's -nomix option.
53
54
55
56netpbm documentation 18 November 2000 Pnmscalefixed User Manual(0)