LinuxCommandLibrary

picttoppm

Convert PICT image files to PPM

TLDR

Convert a PICT file to a PPM image

$ picttoppm [path/to/file.pict] > [path/to/file.ppm]
copy

Force any images in the PICT file to be output at full resolution
$ picttoppm [[-fu|-fullres]] [path/to/file.pict] > [path/to/file.ppm]
copy

Do not assume that the input file contains a PICT header and execute quickdraw operations only
$ picttoppm [[-n|-noheader]] [[-quic|-quickdraw]] [path/to/file.pict] > [path/to/file.ppm]
copy

SYNOPSIS

picttoppm [-alpha] [-background <color>] [-gamma <n>] [-invert] [-verbose] [pictfile]

PARAMETERS

-alpha
    Extracts the alpha channel (transparency) from the PICT image as a PGM (Portable Graymap) image. This output is separate from the main PPM image.

-background <color>
    Specifies the background color for images with transparency or non-rectangular shapes. Areas not explicitly defined by the PICT image will be filled with this color. The color can be a name (e.g., "red"), a hexadecimal RGB value (e.g., "#RRGGBB"), or a Netpbm color name.

-gamma <n>
    Applies a gamma correction of n to the output image. This can be used to adjust the brightness and contrast of the image.

-invert
    Inverts the colors of the output image (negative effect).

-verbose
    Prints verbose information about the PICT file structure and the conversion process to standard error.

pictfile
    The path to the Apple PICT file to be converted. If omitted, picttoppm reads the PICT data from standard input.

DESCRIPTION

picttoppm is a utility from the Netpbm suite of graphics programs. Its primary function is to convert image files in the Apple Macintosh PICT format into the Netpbm Portable Pixmap (PPM) format.

PICT files can contain various types of graphical data, including bitmaps, vector graphics, and text. picttoppm focuses on rendering the bitmap portions and converting them into a pixel-based image format that is easily manipulable by other Netpbm tools.

The PPM format is a simple, uncompressed representation of a color image, making it an excellent intermediate format for further processing, such as converting to GIF, JPEG, or PNG using other Netpbm converters. This command is particularly useful for users dealing with legacy Macintosh image files in a Unix-like environment. It supports both PICT 1 and PICT 2 formats.

CAVEATS

picttoppm might not perfectly render all complex elements of PICT files, especially intricate vector graphics, certain text styles, or advanced QuickDraw operations, as its primary focus is on bitmap conversion.

It is designed for older PICT formats; newer macOS image formats or formats used by modern Apple applications are generally not supported.

The output is an uncompressed PPM, which can result in large file sizes. Users commonly pipe the output to other Netpbm tools for compression (e.g., picttoppm file.pict | ppmtogif > file.gif).

STANDARD INPUT/OUTPUT

If no pictfile is specified as an argument, picttoppm will automatically read the PICT data from standard input. The converted PPM data is always written to standard output. This design makes picttoppm highly suitable for piping operations in shell scripts, allowing seamless integration with other command-line utilities for further image processing or compression.

COLOR HANDLING

The command intelligently handles various color depths present within PICT files, converting them to the full 24-bit color space of the PPM format. The -background option is particularly useful when the PICT file contains transparency or non-rectangular regions, providing the user control over what color fills these areas in the resulting output image.

HISTORY

picttoppm is an integral part of the Netpbm package, a long-standing and widely used toolkit for graphics manipulation on Unix-like systems. Netpbm traces its roots back to the pbmplus package created by Jef Poskanzer in the late 1980s.

picttoppm was specifically developed to handle the conversion of Apple Macintosh PICT files, which were a prevalent image exchange format on that platform during the pre-Internet and early Internet eras. Its continued existence reflects the ongoing need to process legacy image formats in modern computing environments, making older Macintosh graphics accessible.

SEE ALSO

ppm(5), pgm(5), pnm(5), anytopnm(1), ppmtogif(1), ppmtojpeg(1), netpbm(1)

Copied to clipboard