← 返回命令列表

Linux command

pnmdepth 命令

文本

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

常用示例

Change image depth

pnmdepth [newdepth] [input.pnm] > [output.pnm]

Reduce to 8-bit

pnmdepth 255 [input.pnm] > [output.pnm]

Reduce to 4-bit

pnmdepth 15 [input.pnm] > [output.pnm]

说明

pnmdepth changes the maximum sample value (color depth) of PNM images by proportionally rescaling all pixel values. For example, converting from maxval 65535 (16-bit) to 255 (8-bit) scales each sample value accordingly. This is useful for reducing file size by lowering bit depth or for ensuring compatibility with tools that expect specific depth values. Part of the Netpbm toolkit; superseded by pamdepth.

FAQ

What is the pnmdepth command used for?

pnmdepth changes the maximum sample value (color depth) of PNM images by proportionally rescaling all pixel values. For example, converting from maxval 65535 (16-bit) to 255 (8-bit) scales each sample value accordingly. This is useful for reducing file size by lowering bit depth or for ensuring compatibility with tools that expect specific depth values. Part of the Netpbm toolkit; superseded by pamdepth.

How do I run a basic pnmdepth example?

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

Where can I find more pnmdepth examples?

This page includes 3 examples for pnmdepth, plus related commands for nearby Linux tasks.