LinuxCommandLibrary

ppmbrighten

Brighten a PPM image

TLDR

View documentation for the current command

$ tldr pambrighten
copy

SYNOPSIS

ppmbrighten factor [ppmfile]

PARAMETERS

factor
    A non-negative floating-point number representing the brightness adjustment. Values greater than 1 brighten, values between 0 and 1 dim.

[ppmfile]
    The path to the input Portable Pixmap (PPM) image file. If omitted, ppmbrighten reads the PPM image from standard input.

DESCRIPTION

ppmbrighten is a Netpbm tool that adjusts the brightness of a Portable Pixmap (PPM) image.
It works by multiplying each color component (red, green, blue) of every pixel by a specified factor.
If the factor is greater than 1, the image is brightened.
If the factor is less than 1 (but greater than or equal to 0), the image is dimmed.
A factor of 1 leaves the image unchanged.
The output image's maximum color value (maxval) remains the same as the input's, and pixel values are clamped to this maxval if they exceed it after multiplication.

CAVEATS

ppmbrighten works exclusively with the PPM image format. For other Netpbm formats (PGM, PBM), you might need to convert first.
Simple multiplicative scaling can lead to loss of detail in very bright or very dark areas due to value clamping, as pixel values are clipped at the image's maximum color value.
It does not perform gamma correction, which is perceptually different from simple linear brightness adjustment.

INPUT/OUTPUT

ppmbrighten reads its input PPM image from the file specified on the command line or from standard input if no file is given. The processed PPM image is always written to standard output.

MAXVAL HANDLING

The maximum color value (maxval) of the output image is preserved from the input image. Pixel values are scaled by the factor and then clamped to this maxval, meaning values exceeding maxval after scaling will be set to maxval.

HISTORY

Part of the comprehensive Netpbm suite of graphics tools, ppmbrighten embodies the Unix philosophy of small, specialized utilities that do one thing well. Its core functionality for simple brightness adjustment has been a staple of the suite for a long time, providing a fundamental image manipulation capability.

SEE ALSO

netpbm(1), pamgamma(1), pnmgamma(1), ppmdim(1)

Copied to clipboard