LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rasttopnm

Convert Sun raster images to PNM format

TLDR

Convert a Sun raster file to PNM on stdout
$ rasttopnm [input.ras] > [output.pnm]
copy
Read from stdin and write PNM on stdout
$ cat [input.ras] | rasttopnm > [output.pnm]
copy
Output the index plane of a colormapped raster (debugging)
$ rasttopnm -index [input.ras] > [output.pgm]
copy
Convert and pipe to PNG
$ rasttopnm [input.ras] | pnmtopng > [output.png]
copy

SYNOPSIS

rasttopnm [-index] [rastfile]

DESCRIPTION

rasttopnm converts Sun Rasterfile images (.ras) to Portable Anymap (PNM) format, automatically selecting PBM, PGM, or PPM output based on the input image's color depth and colormap. Sun Rasterfile was the native image format on SunOS and Solaris systems and is commonly produced by older X11 tools.Output goes to standard output. Part of the Netpbm toolkit.

PARAMETERS

rastfile

Sun Rasterfile (.ras) input. Reads from stdin if omitted.
-index
For colormapped rasters, output the raw color-index plane as PGM instead of dereferencing it through the colormap to produce PPM. Mainly useful for inspecting the underlying data.

CAVEATS

Some less-common Rasterfile encodings (e.g. RTBYTEENCODED RLE with unusual colormaps) may not be supported on every Netpbm build. The converter chooses the narrowest PNM subtype that can losslessly represent the input.

SEE ALSO

pnmtorast(1), xwdtopnm(1), pnm(5)

Copied to clipboard
Kai