summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-leap-15-6/man1/pamperspective.1
blob: fce28d2c4b9ec02d85c1292f27e6d58b2ab0ce3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it!  If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "Pamperspective User Manual" 0 "2 September 2004" "netpbm documentation"

.SH NAME

pamperspective - a reverse scanline renderer for Netpbm images

.UN synopsis
.SH SYNOPSIS

.nf
\fBpamperspective\fP 
    [\fB--bottom_margin=\fP\fInum\fP]
    [\fB--detail=\fP\fInum\fP]
    [\fB--frame_include=\fP\fIbool\fP]
    [\fB--height=\fP\fInum\fP]
    [\fB--include=[\fP\fIx1\fP,\fIy1\fP;\fIx2\fP,\fIy2\fP; ...]]
    [\fB--input_system=\fP\fIspec\fP]
    [\fB--input_unit=\fP\fIspec\fP]
    [\fB--interpolation=\fP\fIspec\fP]
    [\fB--left_margin=\fP\fInum\fP]
    [\fB--margin=\fP\fInum\fP]
    [\fB--output_system=\fP\fIspec\fP]
    [\fB--proportion=\fP\fIspec\fP]
    [\fB--ratio=\fP\fInum\fP]
    [\fB--right_margin=\fP\fInum\fP]
    [\fB--top_margin=\fP\fInum\fP]
    [\fB--width=\fP\fInum\fP]
    {
      {
        \fIupper_left_x\fP \fIupper_left_y\fP \fIupper_right_x\fP \fIupper_right_y\fP
        \fIlower_left_x\fP \fIlower_left_y\fP \fIlower_right_x\fP \fIlower_right_y\fP
      }
      |
      {
        {\fB--upper_left_x\fP|\fB--ulx\fP}\fB=\fP\fIupper_left_x\fP
        {\fB--upper_left_y\fP|\fB--uly\fP}\fB=\fP\fIupper_left_y\fP
        {\fB--upper_right_x\fP|\fB--urx\fP}\fB=\fP\fIupper_right_x\fP
        {\fB--upper_right_y\fP|\fB--ury\fP}\fB=\fP\fIupper_right_y\fP
        {\fB--lower_left_x\fP|\fB--llx\fP}\fB=\fP\fIlower_left_x\fP
        {\fB--lower_left_y\fP|\fB--lly\fP}\fB=\fP\fIlower_left_y\fP
        {\fB--lower_right_x\fP|\fB--lrx\fP}\fB=\fP\fIlower_right_x\fP
        {\fB--lower_right_y\fP|\fB--lry\fP}\fB=\fP\fIlower_right_y\fP
      }
   }
   [\fIinfile\fP]

.fi

.SH OPTION USAGE
.PP
Minimum unique abbreviation of option is acceptable. (But note 
that shortest unique prefixes might be longer in future versions of 
the program.) You may use single hyphens instead of double hyphen to 
denote options. You may use white space in place of the equals sign 
to separate an option name from its value. All options starting with 
hyphens may be given in any order. 


.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBpamperspective\fP reads a Netpbm image as input and produces a
Netpbm image of the same format as output.
.PP
\fBpamperspective\fP interprets the input image as a perspective
projection of another image which is in a plane oblique to that of the
input image.  For example, a photograph of a painting, taken at an
angle.  The arguments \fIupper_left_x\fP ... \fIlower_right_y\fP
specify a quadrilateral in the photograph that \fBpamperspective\fP
assumes corresponds to a parallelogram in the painting.  The output
image consists of this parallelogram, sheared to a rectangle.  In this
way \fBpamperspective\fP undoes the effect of a raytracer or scanline
renderer.
.PP
Note that if the input image is a projection of a solid scene,
rather than a plane, the result is like a different camera angle on
that scene, to the extent that the scene is shallow from the other
angle.
.PP
The input is from \fIinfile\fP, or from Standard Input, if
\fIinfile\fP is not specified.  The output is to Standard Output.


.UN options
.SH OPTIONS
.PP
For options of the form \fB--name=\fP\fInum\fP, You can specify
the value \fInum\fP in any of the traditional ways.  Additionally,
you can specify it as \fInum1\fP/\fInum2\fP, where \fInum1\fP and
\fInum2\fP are specified traditionally.  This is useful for
specifying a width/height ratio of 4/3, without having to write
infinitely many digits.  Where \fInum\fP is supposed to be a natural
number, \fBpamperspective\fP does not allow this format.

.SS Quadrilateral specification options


.TP
\fB--upper_left_x=\fP\fInum\fP
.TP
\fB--ulx=\fP\fInum\fP

  
This specifies the horizontal coordinate of the upper left
  vertex of the quadrilateral.  The meaning of 'upper left' is
  relative to the output image.  The interpretation of \fInum\fP
  depends on the values for \fB--input_system\fP and
  \fB--input_unit\fP.

.TP
\fB--upper_left_y=\fP\fInum\fP
.TP
\fB--uly=\fP\fInum\fP

  
This specifies the vertical coordinate of the upper left vertex
  of the quadrilateral.  The meaning of 'upper left' is relative to
  the output image.  The interpretation of \fInum\fP depends on the
  values for \fB--input_system\fP and \fB--input_unit\fP.

.TP
\fB--upper_right_x=\fP\fInum\fP
.TP
\fB--urx=\fP\fInum\fP

  
This specifies the horizontal coordinate of the upper right
  vertex of the quadrilateral.  The meaning of 'upper right' is
  relative to the output image.  The interpretation of \fInum\fP
  depends on the values for \fB--input_system\fP and
  \fB--input_unit\fP.

.TP
\fB--upper_right_y=\fP\fInum\fP
.TP
\fB--ury=\fP\fInum\fP

  
This specifies the vertical coordinate of the upper right vertex
  of the quadrilateral.  The meaning of 'upper right' is relative to
  the output image.  The interpretation of \fInum\fP depends on the
  values for \fB--input_system\fP and \fB--input_unit\fP.

.TP
\fB--lower_left_x=\fP\fInum\fP
.TP
\fB--llx=\fP\fInum\fP

  
This specifies the horizontal coordinate of the lower left
  vertex of the quadrilateral.  The meaning of 'lower left' is
  relative to the output image.  The interpretation of \fInum\fP
  depends on the values for \fB--input_system\fP and
  \fB--input_unit\fP.

.TP
\fB--lower_left_y=\fP\fInum\fP
.TP
\fB--lly=\fP\fInum\fP

  
This specifies the vertical coordinate of the lower left vertex
  of the quadrilateral.  The meaning of 'lower left' is relative to
  the output image.  The interpretation of \fInum\fP depends on the
  values for \fB--input_system\fP and \fB--input_unit\fP.

.TP
\fB--lower_right_x=\fP\fInum\fP
.TP
\fB--lrx=\fP\fInum\fP

  
This specifies the horizontal coordinate of the lower right
  vertex of the quadrilateral.  The meaning of 'lower right' is
  relative to the output image.  The interpretation of \fInum\fP
  depends on the values for \fB--input_system\fP and
  \fB--input_unit\fP.

.TP
\fB--lower_right_y=\fP\fInum\fP
.TP
\fB--lry=\fP\fInum\fP

  
This specifies the vertical coordinate of the lower right vertex
  of the quadrilateral.  The meaning of 'lower right' is relative to
  the output image.  The interpretation of \fInum\fP depends on the
  values for \fB--input_system\fP and \fB--input_unit\fP.

.TP
\fB--input_system=\fP\fIsystem\fP
.TP
\fB--input_unit=\fP\fIunit\fP

  
The input image consists of pixels, which are, from the point of
  view of a scanline renderer, solid squares.  These options specify
  how the coordinates are interpreted:


.TP
\fIsystem\fP=\fBlattice\fP, \fIunit\fP=\fBimage\fP

    
(0,0) refers to the upper left corner of the upper left pixel
    and (1,1) refers to the lower right corner of the lower right
    pixel.

.TP
\fIsystem\fP=\fBlattice\fP, \fIunit\fP=\fBpixel\fP

    
(0,0) refers to the upper left corner of the upper left pixel
    and (\fIwidth\fP,\fIheight\fP) refers to the lower right corner
    of the lower right pixel.  Here \fIwidth\fP and \fIheight\fP are
    the width and height of the input image.

.TP
\fIsystem\fP=\fBpixel\fP, \fIunit\fP=\fBimage\fP

    
(0,0) refers to the center of the upper left pixel and (1,1)
    refers to the center of the lower right pixel.

.TP
\fIsystem\fP=\fBpixel\fP, \fIunit\fP=\fBpixel\fP

    
(0,0) refers to the center of the upper left pixel and
    (\fIwidth\fP-1,\fIheight\fP-1) refers to the center of the lower
    right pixel.  Here \fIwidth\fP and \fIheight\fP are the width
    and height of the input image.



  The defaults are \fB--input_system\fP=\fBlattice\fP and
  \fB--input_unit\fP=\fBpixel\fP.  Point-and-click front ends should
  use \fB--input_system\fP=\fBpixel\fP.



.UN frameoptions
.SS Frame Options

By default \fBpamperspective\fP outputs exactly the above
parallelogram, sheared to a rectangle.  With the following options, it
is possible to make \fBpamperspective\fP output a larger or smaller
portion, which we call the "visible part." We refer to the
default rectangle as the "frame." The visible part is always
a rectangle the axes of which are parallel to those of the frame.
.PP
The frame options are additive.  All the parts of the image
specified by either margin options, \fB--include_frame\fP, or
\fB--include\fP (or their defaults) are in the visible part.  The
visible part is the smallest possible rectangle that contains the
parts specified those three ways.
.PP
The visible part must have nonzero size.  That means if you specify
\fB--frame_include=no\fP (overriding the default), you'll need to
specify other frame options in order to have something in the visible
part.


.TP
[\fB--margin=\fP\fInum\fP]

  
This specifies an area surrounding the frame that is to be
  included in the visible part.  The units of \fInum\fP are the width
  of the frame for the horizontal extensions and the height of the
  frame for vertical extensions.
.sp
For example, \fB--margin=1\fP makes the visible part 9 times as large,
  because it makes the visible part extend one frame's worth to the left
  of the frame, one frame's worth to the right, one frame's worth above
  the frame, and one frame's worth below the frame, for a total of
  3 frames' worth in both dimensions.
.sp
A negative value has an effect only if you specify
  \fB--frame_include=no\fP.  The default is no margin.
.sp
The individual margin options below override this common margin
  setting.


.TP
[\fB--top_margin=\fP\fInum\fP]
.TP
[\fB--left_margin=\fP\fInum\fP]
.TP
[\fB--right_margin=\fP\fInum\fP]
.TP
[\fB--bottom_margin=\fP\fInum\fP]

  
These are like \fB--margin\fP, but they specify only one of 
  the 4 sides.  The default value for each is the value (or default) of
  \fB--margin\fP.


.TP
[\fB--frame_include=\fP\fIbool\fP]

  
Valid values for \fIbool\fP are:


.TP
\fByes\fP
.TP
\fBtrue\fP
.TP
\fBon\fP

    
The frame itself is in the visible part.

.TP
\fBno\fP
.TP
\fBfalse\fP
.TP
\fBoff\fP

    
The frame itself is not necessarily in the visible part
    (but it could be if other options cause it to be).




  The default value is \fByes\fP

.TP
\fB--include=[\fP\fIx1\fP,\fIy1\fP;\fIx2\fP,\fIy2\fP; ...]

  
The visible part is made large enough such that every point
  (\fIx1\fP,\fIy1\fP), (\fIx2\fP,\fIy2\fP), of the \fIinput\fP image is 
  visible.  The meaning of \fIx\fP and \fIy\fP is determined by
  \fB--input_system\fP and \fB--input_unit\fP.  You can specify any
  number of semicolon-delimited points, including zero.
.sp
If you're supplying these options via a Unix command shell, be
  sure to use proper quoting, because semicolon (\fB;\fP) is usually
  a shell control character.



  
.PP
The frame options were new in Netpbm 10.25 (October 2004).

.UN outputsizeoptions
.SS Output Size Options


.TP
\fB--width=\fP\fIwidth\fP
.TP
\fB--height=\fP\fIheight\fP

  
These specify the size of the output image in horizontal and
  vertical direction.  The values are numbers of pixels, so only
  natural numbers are valid.  These values override the default
  means to determine the output size.

.TP
\fB--detail=\fP\fInum\fP

  
If you do not specify \fB--width\fP, \fBpamperspective\fP
  determines the width of the output image such that moving \fInum\fP
  output pixels horizontally does not change the corresponding pixel
  coordinates of the input image by more than 1.
  \fBpamperspective\fP determines the height of the output image
  analogously.  The default value is 1.

.TP
\fB--proportion=\fP\fIprop\fP
.TP
\fB--ratio=\fP\fIratio\fP

  
Valid values for \fIprop\fP are:


.TP
\fBfree\fP

    
In this case \fB--ratio\fP does not have any effect.

.TP
\fBfixed\fP
After the width and height are determined
    according to \fB--detail\fP, one of both will be increased, in
    order to obtain width/height=\fIratio\fP.



  The defaults are \fB--proportion\fP=\fBfree\fP and
  \fB--ratio\fP=1.



.UN outputoptions
.SS Output Options


.TP
\fB--output_system=\fP\fIspec\fP

  
The output image consists of pixels, which are, from the point
  of view of a scanline renderer, solid squares.  This option
  specifies how the four vertices of the quadrilateral correspond to
  the pixels of the output image.  Valid values for \fIspec\fP are:


.TP
\fBlattice\fP

    
The upper left vertex corresponds to the upper left corner of
    the upper left pixel and The lower right vertex corresponds to the
    lower right corner of the lower right
    pixel.

.TP
\fBpixel\fP

    
The upper left vertex corresponds to the center of the upper
    left pixel and The lower right vertex corresponds to the center of
    the lower right pixel.



  The default value is \fBlattice\fP.  Point-and-click front ends
  should use \fBpixel\fP.

.TP
\fB--interpolation=\fP\fIspec\fP

  
Usually (centers of) output pixels do not exactly correspond to
  (centers of) input pixels.  This option determines how the program
  will choose the new pixels.  Valid values for \fIspec\fP are:


.TP
\fBnearest\fP

    
The output pixel will be identical to the nearest input
    pixel.

.TP
\fBlinear\fP

    
The output pixel will be a bilinear interpolation of the four
    surrounding input pixels.



  The default value is \fBnearest\fP.



.UN hints
.SH HINTS
.PP
It might be tempting always to use the options
\fB--include 0,0;0,1;1,0;1,1\fP 
(assuming \fB--input_system=lattice\fP and \fB--input_unit=image\fP), 
so that no part of the input image is missing in the output. 
There are problems with that:


.IP \(bu
If the three dimensional plane defined by the quadrilateral has a
  visible horizon in the input image, then the above asks \fBpamperspective\fP
  to include points that cannot ever be part of the output.

.IP \(bu
If the horizon is not visible, but close to the border of the
  input image, this may result in \fIvery\fP large output
  files. Consider a picture of a road. If you ask for a point close to
  the horizon to be included, then this point is far away from the
  viewer. The output will cover many kilometers of road, while
  \fB--detail\fP perhaps makes a pixel represent a square centimeter.

  
.PP
When working with large files \fBpamperspective\fP's memory usage
might be an issue.  In order to keep it small, you should minimize each
of the following:


.IP \(bu
The vertical range that the top output line consumes in the
  input image;

.IP \(bu
The vertical range that the bottom output line consumes in the
  input image;

.IP \(bu
The vertical range from the topmost (with respect to the 
  input image) quadrilateral point to the top (with respect to the output 
  image) output line.

  

For this purpose you can use \fBpamflip\fP before and/or after
\fBpamperspective\fP. Example: Instead of

.nf
\fBpamperspective 10 0 100 50 0 20 95 100 infile > outfile\fP
.fi

you can use

.nf
\fB
pamflip -rotate90 infile | 
   pamperspective 50 0 100 5 0 90 20 100 | 
   pamflip -rotate270 > outfile
\fP
.fi
  
.UN seealso
.SH SEE ALSO
.BR "\fBnetpbm\fP" (1)\c
\&,
.BR "\fBpam\fP" (1)\c
\&,
.BR "\fBpnm\fP" (1)\c
\&,
.BR "\fBpamcut\fP" (1)\c
\&,
.BR "\fBpamflip\fP" (1)\c
\&,
.BR "\fBpnmrotate\fP" (1)\c
\&,
.BR "\fBpamscale\fP" (1)\c
\&,
.BR "\fBpnmshear\fP" (1)\c
\&,
.BR "\fBpnmstitch\fP" (1)\c
\&

.UN history
.SH HISTORY
.PP
Mark Weyer wrote \fBpamperspective\fP in March 2004.
.PP
It was new in Netpbm 10.22 (April 2004).


.UN author
.SH AUTHOR

This documentation was written by Mark Weyer.  Permission is granted
to copy, distribute and/or modify this document under the terms of the
GNU General Public License, Version 2 or any later version published
by the Free Software Foundation.
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source.  The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/pamperspective.html
.PP