\ .\" 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 "Pamrestack User Manual" 1 "" "netpbm documentation" Updated: .SH NAME pamrestack - Rearrange rows of a Netpbm image .UN synopsis .SH SYNOPSIS \fBpamrestack\fP [\fB-width=\fP\fIwidth\fP] [\fB-trim=\fP{\fBfill\fP|\fBcrop\fP|\fBabort\fP}] [\fB-verbose\fP] [\fIpamfile\fP] .PP Minimum unique abbreviations of option are acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. .UN description .SH DESCRIPTION .PP This program is part of .BR "Netpbm" (1)\c \&. .PP \fBpamrestack\fP rearranges the pixels of a Netpbm image into different size rows. E.g. if an image is 100 pixels wide and 50 pixels high, you can rearrange it to 125 wide and 40 high. In that case, 25 pixels from the start of the 2nd row of the input would be moved to the end of the 1st row of input, 50 pixels from the 3rd row would be moved to the 2nd row, etc. .PP Put another way, \fBpamrestack\fP arranges all the input rows into one long sequence and produces output rows therefrom, in FIFO order. .PP Input is from Standard Input if you don't specify the input file \fIpamfile\fP. .PP Output is to Standard Output. .PP \fBpamrestack\fP works on a multi-image stream. It cuts each image in the stream independently and produces a multi-image stream output. .UN options .SH OPTIONS .PP In addition to the options common to all programs based on libnetpbm (most notably \fB-quiet\fP, see .UR index.html#commonoptions Common Options .UE \&), \fBpamrestack\fP recognizes the following command line options: .TP \fB-width=\fP\fIwidth\fP The width of the output. If this option is not specified, the output will consist of a single row wide enough to contain all the pixels of the input image. .TP \fB-trim=\fP{\fBfill\fP|\fBcrop\fP|\fBabort\fP} This option specifies what to do when the new width does not cleanly divide the number of pixels in the input image. .TP \fBfill\fP (Default) Complete the final row by adding black pixels as necessary. .TP \fBcrop\fP Discard the final partial row. If this means there is nothing to output, fail the program. .TP \fBabort\fP Fail the program.. .TP \fB-verbose\fP Print information about the processing to Standard Error. .UN usage .SH USAGE .PP \fBpamrestack\fP is a general editor with many possible uses. .IP \(bu \fBpamrestack\fP can rearrange into rectangles single-dimension images produced by programs such as \fBppmhist\fP and \fBpamseq\fP. This makes the output easier to examine with a viewer. Conversely, \fBpamrestack\fP can be used to convert a normal rectangular image into one wide row or one tall column if that is desirable for compression, conversion, or analysis. .IP \(bu \fBpamrestack\fP can repair images corrupted by an incorrect width value in the header. Images grabbed from the framebuffer device often exhibit this problem. .IP \(bu \fBpamrestack\fP can be used with \fBpamdice\fP, \fBpamundice\fP, \fBpamcat\fP, etc. to divide and combine images in the process of interlacing. .UN examples .SH EXAMPLES .IP \(bu Rearrange the one-dimensional output of \fBpamseq\fP into a square: .nf \f(CW pamseq 3 255 | pamrestack -width=4096 \fP .fi .IP \(bu Combine two files, each 600 pixels wide, one with the odd rows and another with the even rows, to construct an interlaced image: .nf \f(CW pamcat -leftright oddrows.ppm evenrows.ppm | pamrestack -width=600 \fP .fi .IP \(bu Like the above, but invert all pixels in the even rows left to right to produce a serpentine interlace: .nf \f(CW pamflip -leftright evenrows.ppm | pamcat -leftright oddrows.ppm - | pamrestack -width 600 \fP .fi .UN seealso .SH SEE ALSO .BR "pamseq" (1)\c \&, .BR "ppmhist" (1)\c \&, .BR "pnmshear" (1)\c \&, .BR "pamscale" (1)\c \&, .BR "pamdeinterlace" (1)\c \&, .BR "pamdice" (1)\c \&, .BR "pamundice" (1)\c \&, .BR "pamcat" (1)\c \&, .BR "pam" (1)\c \& .UN history .SH HISTORY .PP \fBpamrestack\fP was new in Netpbm 10.99 (June 2022). .UN author .SH AUTHOR By Akira F. Urushibata. Contributed to the public domain by the author. .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/pamrestack.html .PP