pammixinterlace
Interlace two PAM images together
TLDR
Merge each row in an image with its two neighbours
Use the specified filtering mechanism
Turn on adaptive filtering mode, i.e., only modify pixels that are obviously part of a comb pattern
SYNOPSIS
pammixinterlace [-alpha] [-fieldrows=N] [pamfile1 [pamfile2]]
PARAMETERS
pamfile1
The input PAM image to be used for the odd scan lines. If '-', it reads from standard input.
pamfile2
The input PAM image to be used for the even scan lines. If '-', it reads from standard input. If both pamfile1 and pamfile2 are omitted, both images are read sequentially from standard input.
-alpha
If specified, pammixinterlace expects the input images to be 4-channel PAM images (e.g., RGB_ALPHA), and it will interleave the alpha channel along with the color channels. If omitted, only the color channels are processed, and any alpha channel in the input is ignored or discarded.
-fieldrows=N
This option allows specifying the number of rows that constitute a "field" in the interlacing process. By default, N is 1, meaning it interleaves row by row. If set to 2, for example, it would take two rows from the first image, then two from the second, and so on. This provides flexibility for non-standard scan patterns.
-help
Displays a brief usage message and exits.
-version
Displays the program's version information and exits.
DESCRIPTION
pammixinterlace is a Netpbm program that combines two input PAM (Portable Arbitrary Map) or PPM (Portable Pixmap) images into a single interlaced image.
It takes one image that represents the "odd" scan lines (e.g., from an odd field of a video) and another image representing the "even" scan lines (e.g., from an even field). The output image is constructed by interleaving the scan lines from these two inputs. This is particularly useful for video processing applications where fields might be processed separately and then need to be re-combined. The input images must have the same dimensions (width and height), and will be processed in the order given: the first input's rows become the odd rows of the output, and the second input's rows become the even rows.
CAVEATS
Input images must have identical dimensions (width and height); otherwise, the program will terminate with an error.
The command primarily works with Netpbm formats (PAM/PPM). Ensure your input images are in a compatible format or convert them first using other Netpbm tools like anytopnm.
STANDARD INPUT/OUTPUT
The command reads the first image from pamfile1 and the second from pamfile2. If a filename is specified as '-', the image is read from standard input. If no filenames are given, both images are read sequentially from standard input.
The resulting interlaced image is always written to standard output. This design makes pammixinterlace highly suitable for integration into shell pipelines, allowing for seamless chaining with other Netpbm utilities.
HISTORY
pammixinterlace is an integral part of the Netpbm project, a comprehensive toolkit for manipulating graphic images. Netpbm originated from the Pbmplus package, created by Jef Poskanzer in the late 1980s, and has undergone continuous development. This specific tool was developed to address the common video processing requirement of re-combining separated video fields, underscoring the toolkit's broad utility in both general image manipulation and specialized media processing.
SEE ALSO
pamdeinterlace(1), pamstack(1), pamcat(1), ppm(5), pam(5)