Linux command
pamslice 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Extract a horizontal slice
pamslice -row=[100] [input.pam]
Extract a vertical slice
pamslice -column=[50] [input.pam]
Extract only the red plane
pamslice -row=[100] -plane=[0] [input.ppm]
Format output for xmgr plotting
pamslice -row=[100] -xmgr [input.pam]
说明
pamslice extracts one line of pixels (a row or column) from a Netpbm image and prints the sample values as ASCII decimal numbers. The first number on each output line is the position index (column number for row slices, row number for column slices), followed by the sample values for each plane. This is useful for generating profile data from images, such as plotting intensity values along a scanline for image analysis. The output can be fed directly into plotting tools like xmgr using the -xmgr option. Either -row or -column must be specified, but not both.
参数
- -row=_N_
- Extract row N as a horizontal slice. Rows are numbered from the top starting with 0.
- -column=_N_
- Extract column N as a vertical slice. Columns are numbered from the left starting with 0.
- -plane=_N_
- Restrict output to a single color plane. For PPM images: 0=red, 1=green, 2=blue. Omit for all planes.
- -xmgr
- Format output as input for the xmgr plotting program by adding header information.
FAQ
What is the pamslice command used for?
pamslice extracts one line of pixels (a row or column) from a Netpbm image and prints the sample values as ASCII decimal numbers. The first number on each output line is the position index (column number for row slices, row number for column slices), followed by the sample values for each plane. This is useful for generating profile data from images, such as plotting intensity values along a scanline for image analysis. The output can be fed directly into plotting tools like xmgr using the -xmgr option. Either -row or -column must be specified, but not both.
How do I run a basic pamslice example?
Run `pamslice -row=[100] [input.pam]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -row=_N_ do in pamslice?
Extract row N as a horizontal slice. Rows are numbered from the top starting with 0.