LinuxCommandLibrary

ppmtv

Play PPM image sequences as video

TLDR

Give the PPM image an American TV appearance

$ ppmtv [dim_factor] [path/to/file.ppm] > [path/to/output.ppm]
copy

Suppress all informational messages
$ ppmtv [[-q|-quiet]]
copy

Display version
$ ppmtv [[-v|-version]]
copy

SYNOPSIS

ppmtv [-ntsc | -pal] [-overscan percent] [-square] [-half] [-gamma gamma] [-srgb | -notsrgb] [-dither] [-nodither] [-colors n] [-ncol n] [-maxcol n] [-cmap cmapfile] [-verbose] [inputfile]

PARAMETERS

-ntsc
    Optimize the output for NTSC television standards. This is the default if neither -ntsc nor -pal is specified.

-pal
    Optimize the output for PAL television standards.

-overscan percent
    Specifies the percentage of the image's width and height that is considered 'overscan' and will be cropped or scaled into the visible area. The default is 5 percent.

-square
    Forces the output image to have square pixels. This may result in an incorrect aspect ratio when viewed on a TV, as televisions typically have non-square pixels.

-half
    Halves the horizontal resolution of the output image. Useful for creating images suitable for older or lower-resolution TV displays.

-gamma gamma
    Applies a specified gamma correction to the image. This is crucial for accurate color representation, as computer monitors and TVs have different gamma curves. The default gamma is 2.2.

-srgb
    Indicates that the input image is in the sRGB color space. This is the default behavior if no gamma option is specified.

-notsrgb
    Indicates that the input image is not sRGB, implying a linear light response, typically used with a custom -gamma value.

-dither
    Forces dithering when the image's color depth is reduced. Dithering helps to simulate a wider range of colors by interspersing pixels of different colors.

-nodither
    Prevents dithering even if the image's color depth is reduced. This might lead to banding or posterization effects.

-colors n
    Reduces the image to a maximum of n colors using a color quantization algorithm, typically with dithering enabled by default.

-ncol n
    An alias for -colors n.

-maxcol n
    An alias for -colors n.

-cmap cmapfile
    Uses the colors from the specified cmapfile (a PPM image) as the target color map for the output image. This ensures the output uses a predefined palette.

-verbose
    Prints informative messages about the image processing steps to standard error, including input/output dimensions, color information, and transformations applied.

inputfile
    The path to the input PPM image file. If omitted, ppmtv reads the PPM image from standard input.

DESCRIPTION

ppmtv is a command-line utility from the Netpbm image manipulation toolkit. Its primary function is to convert a Portable Pixmap (PPM) image file into another PPM file that is optimized for display on a standard NTSC or PAL television monitor.

Traditional computer displays and television screens have different characteristics, including pixel aspect ratios, overscan areas, and color reproduction capabilities. ppmtv addresses these differences by performing several transformations: it corrects the image's aspect ratio to prevent distortion on non-square TV pixels, adjusts for the TV's overscan area (the portion of the image that is typically cut off at the edges of the screen), and optionally reduces the color depth and applies dithering to simulate a wider range of colors within the television's limited palette.

This ensures that images originally designed for computer monitors appear correctly proportioned and visually appealing when viewed on a television. It reads a PPM image from standard input and writes the processed PPM image to standard output.

CAVEATS

ppmtv is specifically designed for standard analog television displays (CRT-based NTSC/PAL systems). Results on modern digital displays (LCD, LED, OLED) via HDMI or other digital connections may vary, as these displays often handle aspect ratio and scaling differently. Using -square can lead to distorted images on televisions with non-square pixels. Color reduction and dithering, while necessary for some TV systems, can alter the artistic intent of the original image.

STANDARD INPUT/OUTPUT

Like many Netpbm utilities, ppmtv is designed to operate as a filter in a pipeline. It reads a PPM image from standard input if no input file is specified and writes the processed PPM image to standard output. This allows for seamless integration with other commands, such as cat, pnmscale, or convert.

COLOR SPACE AND GAMMA CORRECTION

Accurate color reproduction on a television display is critical, and ppmtv provides options to handle color space and gamma correction. The -srgb and -notsrgb options inform ppmtv about the input image's color profile, while the -gamma option allows for precise adjustment of the image's brightness curve to match the target display's characteristics, ensuring colors appear as intended on a TV.

HISTORY

ppmtv is a component of the Netpbm image manipulation toolkit, which originated from the PBMplus package developed by Jef Poskanzer in the late 1980s. The Netpbm project evolved over time, becoming a widely used collection of command-line tools for processing various image formats, particularly the PNM (Portable Anymap) family. ppmtv was developed to address the specific challenges of displaying computer-generated graphics on consumer television sets during an era when such integration was common for video production, multimedia presentations, and early game development. Its design reflects the technical specifications and limitations of analog NTSC and PAL broadcast standards, making it a specialized tool for that particular conversion need.

SEE ALSO

ppm(5), netpbm(1), pnmgamma(1), pnmremap(1), pnmscale(1)

Copied to clipboard