LinuxCommandLibrary

sldtoppm

Convert Sun rasterfiles to portable pixmap

TLDR

Convert an SLD file to a PPM image

$ sldtoppm [path/to/input.sld] > [path/to/output.ppm]
copy

Compensate for non-square pixels by scaling the width of the image
$ sldtoppm [[-a|-adjust]] [path/to/input.sld] > [path/to/output.ppm]
copy

SYNOPSIS

sldtoppm [-alpha] [-negate] [sldfile]

PARAMETERS

-alpha
    Makes the background of the output PPM image transparent instead of solid black. This is useful for overlaying the image onto other backgrounds using tools like pamstack.

-negate
    Inverts the colors of the image, resulting in a white background with black lines/elements, as opposed to the default black background with colored lines.

sldfile
    The path to the input Gould plot SLD file. If not specified, sldtoppm reads the SLD data from standard input.

DESCRIPTION

sldtoppm is a specialized utility within the comprehensive Netpbm image manipulation toolkit. Its primary function is to convert Gould plot slide (SLD) files into the Portable Pixmap (PPM) image format. SLD files are a specific, older graphical format typically generated by the gould.plot program, often used for scientific or engineering plots.

sldtoppm reads the SLD data from a specified input file or from standard input if no file is provided, and it outputs the resulting PPM image to standard output. This tool is invaluable for integrating legacy Gould plot data into modern digital workflows, enabling users to view, edit, or combine these plots with other images using the vast array of Netpbm utilities, such as pamstack for layering or pnmtopng for converting to more common formats. Its filter-like operation makes it suitable for scripting and piping in command-line environments.

CAVEATS

Gould plot SLD files are a somewhat niche and older format. The gould.plot utility that generates these files might not be readily available or widely used in modern environments. sldtoppm specifically handles this legacy format, and its utility is primarily for working with existing SLD data.

STANDARD INPUT/OUTPUT USAGE

sldtoppm operates as a filter, reading its input from a file specified on the command line or from standard input (stdin) if no file is given. The converted PPM image is always written to standard output (stdout). This design allows for easy piping of data, for example:
cat plot.sld | sldtoppm -negate > plot.ppm
or
some_program_outputting_sld | sldtoppm > image.ppm

HISTORY

sldtoppm is part of the long-standing Netpbm image manipulation toolkit, which originated from the PBMplus toolkit. Netpbm has evolved over many years, providing a comprehensive collection of small, specialized tools for converting and manipulating various image formats, often designed to work together in command-line pipelines. sldtoppm serves as a specific converter for an older scientific plotting format, reflecting Netpbm's dedication to handling diverse graphical data and supporting legacy systems.

SEE ALSO

ppm(5), pamstack(1), gould.plot(1)

Copied to clipboard