← 返回命令列表

Linux command

pgmnorm 命令

文本

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

常用示例

Normalize image contrast

pgmnorm [input.pgm] > [output.pgm]

Normalize with custom percentile cutoffs

pgmnorm -bpercent [2] -wpercent [1] [input.pgm] > [output.pgm]

Specify exact pixel values for black and white mapping

pgmnorm -bvalue [30] -wvalue [220] [input.pgm] > [output.pgm]

Normalize while preserving hues

pgmnorm -keephues [input.ppm] > [output.ppm]

说明

pgmnorm reads a PNM image (PBM, PGM, or PPM), normalizes the contrast by forcing the darkest pixels to black and the lightest pixels to white, and linearly rescales the values in between. It outputs the same kind of image. This is an older name for pnmnorm. By default, the darkest 2 percent of pixels are mapped to black and the lightest 1 percent to white. These thresholds can be changed with -bpercent and -wpercent, or exact cutoff values can be specified with -bvalue and -wvalue. If both percentage and value options are given for the same end, the one producing the least change is used. Part of the Netpbm toolkit.

参数

-bpercent _n_
Percentage of darkest pixels to map to black. Default: 2.
-wpercent _n_
Percentage of lightest pixels to map to white. Default: 1.
-bvalue _n_
Exact pixel value to map to black (overrides -bpercent if it produces less change).
-wvalue _n_
Exact pixel value to map to white (overrides -wpercent if it produces less change).
-keephues
Keep each pixel the same hue; only adjust brightness. Without this, components are normalized independently, which may shift hues.
-brightmax
Use the most intense RGB component as the pixel's brightness instead of luminosity.

FAQ

What is the pgmnorm command used for?

pgmnorm reads a PNM image (PBM, PGM, or PPM), normalizes the contrast by forcing the darkest pixels to black and the lightest pixels to white, and linearly rescales the values in between. It outputs the same kind of image. This is an older name for pnmnorm. By default, the darkest 2 percent of pixels are mapped to black and the lightest 1 percent to white. These thresholds can be changed with -bpercent and -wpercent, or exact cutoff values can be specified with -bvalue and -wvalue. If both percentage and value options are given for the same end, the one producing the least change is used. Part of the Netpbm toolkit.

How do I run a basic pgmnorm example?

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

What does -bpercent _n_ do in pgmnorm?

Percentage of darkest pixels to map to black. Default: 2.