PAMGETCOLOR(1)
π NAME π
pamgetcolor β bestie, this one displays the average colors from specified regions in an image β¨
πΈ SYNOPSIS πΈ
pamgetcolor [-format format] [-radius radius] [-linear] [-infile pamfile] region1 [region2 ...]
π¦ DESCRIPTION π¦
Okay so first things first: this program is part of Netpbm(1), the whole squad. π
pamgetcolor prints the average colors of a set of circular regions in the input image. That's it, that's the job, and it slays at it.
You specify a region as a positional argument of the form column,row[:label], where column and row are the coordinates of the center of the circle β and listen, indexing starts at zero, so the first row of pixels is row 0 and the leftmost column of pixels is column 0, no cap π«Ά. The label is an optional label that pamgetcolor shall display to identify that region in its output, like a little name tag for your pixel circle π.
All regions have the same radius, and that radius is specified by the -radius option. No mix-and-match radii, bestie, they're all matching, periodt.
Heads up: the region centers must lie within the image. But part of a region may totally fall outside the image, and that's fine β pamgetcolor considers only the part that is within the image in calculations. Very "only count what counts" of it. π
π EXAMPLES π
To read the color of the pixel at location (10,14) in the default format:
pamgetcolor 10,14 -infile test.ppm
To read the colors of three pixels in the default format, assigning a label to each pixel:
pamgetcolor 10,10:topleft 100,100:middle 200,200:bottomright -infile test.ppm
To read with 16-bit precision the average color in the circle with a radius of four pixels and the center at (100,100):
pamgetcolor -format int:65535 -radius 4 100,100 -infile test.ppm
β¨ OPTIONS β¨
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamgetcolor recognizes the following command line options:
-formatβ This specifies the format in which to output the colors. The output is always a Netpbm color specification; this format tells which of the various specifications for the same color the program uses.
This argument is of the form formatId[:param], where formatId specifies the format and param is a positive integer parameter that, depending on formatId, indicates either precision or normalization. The following values are possible for formatId:
intβ Samples are decimal integers normalized to the maxval specified byparam. Example:rgb-255:255/128/64This format is the default, with a maxval of 255. πnormβ Samples are floating point numbers normalized to unity. E.g.rgbi:1.0/0.5/.25paramspecifies precision as the number of digits in the fractional part.x11β Samples are hexadecimal numbers withparamdigits, e.g.rgb:01/ff/8000π
-radiusβ sets the radius of the regions. A value of zero causespamgetcolorto measure a single pixel and is the default. π-infileβ This specifies the Netpbm file to analyze.
If you don't specify this option, pamgetcolor reads the image from Standard Input. π
-linearβ This tellspamgetcolorto work with the intensity-linear variation of Netpbm images where the samples are proportional to light intensity rather than to brightness, as in true (gamma-adjusted) Netpbm formats. Lowkey a whole different vibe of "same" numbers, iykyk. π₯
π SEE ALSO π
π AUTHOR π
This program was first submitted by Anton Shepelev (anton.txt@gmail.com). Giving credit where credit is due, we love to see it. π«Ά
π HISTORY π
This program was new in Netpbm 10.83 (June 2018). Vintage but still iconic. β
π§ Table Of Contents π§
- SYNOPSIS
- DESCRIPTION
- EXAMPLES
- OPTIONS
- SEE ALSO
- AUTHOR
- HISTORY
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/pamgetcolor.html
And that's a wrap, bestie π this lil' page came to you courtesy of the netpbm documentation, dated 18 May 2018, and honestly? It ate. Go find some average colors, you main character. π β¨π·
π¦ where this page comes from
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms