← 返回命令列表

Linux command

rasttopnm 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Convert

rasttopnm [input.ras] > [output.pnm]

Read from stdin

cat [input.ras] | rasttopnm > [output.pnm]

Output the index plane

rasttopnm -index [input.ras] > [output.pgm]

Convert and pipe

rasttopnm [input.ras] | pnmtopng > [output.png]

说明

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.

参数

-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.

FAQ

What is the rasttopnm command used for?

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.

How do I run a basic rasttopnm example?

Run `rasttopnm [input.ras] > [output.pnm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -index do in rasttopnm?

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.