1Pnmscalefixed User Manual(0) Pnmscalefixed User Manual(0)
2
3
4
6 pnmscalefixed - scale a PNM file quickly
7
8
10 This program is part of Netpbm(1).
11
12 pnmscalefixed is like pamscale except that it uses fixed point arith‐
13 metic internally instead of floating point, which may make it run
14 faster. In turn, it is less accurate and may distort the image. It
15 also lacks many of the features of pamscale.
16
17 Use the pamscale user manual with pnmscalefixed. This document only
18 describes the difference. Avoid any feature mentioned in the pamscale
19 manual as not existing before Netpbm 9.9.
20
21 pnmscalefixed uses fixed point 12 bit arithmetic. By contrast, pam‐
22 scale uses floating point arithmetic which on most machines is probably
23 24 bit precision. This makes pnmscalefixed run faster (30% faster in
24 one experiment), but the imprecision can cause distortions at the right
25 and bottom edges.
26
27 The distortion takes the following form: One pixel from the edge of the
28 input is rendered larger in the output than the scaling factor
29 requires. Consequently, the rest of the image is smaller than the
30 scaling factor requires, because the overall dimensions of the image
31 are always as requested. This distortion will usually be very hard to
32 see.
33
34 pnmscalefixed with the -verbose option tells you how much distortion
35 there is.
36
37 The amount of distortion depends on the size of the input image and how
38 close the scaling factor is to an integral 1/4096th.
39
40 If the scaling factor is an exact multiple of 1/4096, there is no dis‐
41 tortion. So, for example doubling or halving an image causes no dis‐
42 tortion. But reducing it or enlarging it by a third would cause some
43 distortion. To consider an extreme case, scaling a 100,000 row image
44 down to 50,022 rows would create an output image with all of the input
45 squeezed into the top 50,000 rows, and the last row of the input copied
46 into the bottom 22 rows of output.
47
48 pnmscalefixed could probably be modified to use 16 bit or better arith‐
49 metic without losing anything. The modification would consist of a
50 single constant in the source code. Until there is a demonstrated need
51 for that, though, the Netpbm maintainer wants to keep the safety cush‐
52 ion afforded by the original 12 bit precision.
53
54 pnmscalefixed does not have pamscale's -nomix option.
55
56
58 In addition to the options common to all programs based on libnetpbm
59 (most notably -quiet, see
60 Common Options ⟨index.html#commonoptions⟩ ), pnmscalefixed recognizes
61 the following command line options:
62
63
64
65 -xsize
66
67 -width
68
69 -ysize
70
71 -height
72
73 -xscale
74
75 -yscale
76
77 -pixels
78
79 -xysize
80
81 -reduce
82
83 These options determine the scale factors. See the pamscale(1)
84 user manual for details.
85
86
87 -verbose
88
89 Report details of the transformation.
90
91
92
94 pnmscalefixed was originally pnmscale. In Netpbm 9.9 (November 2000)
95 pnmscale was rewritten to use floating point arithmetic; the former
96 fixed point arithmetic version was renamed pnmscalefixed.
97
98
100 pamscale(1), pamstretch(1), pamstretch-gen(1), pbmreduce(1), pbmp‐
101 scale(1), pamenlarge(1), pnmscale(1), pnm(1), pam(1)
102
104 This manual page was generated by the Netpbm tool 'makeman' from HTML
105 source. The master documentation is at
106
107 http://netpbm.sourceforge.net/doc/pnmscalefixed.html
108
109netpbm documentation 01 July 2020 Pnmscalefixed User Manual(0)