# man > pamgetcolor(1)

_Pamgetcolor_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)             General Commands Manual            _Pamgetcolor_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

## NAME
       pamgetcolor - display the average colors from specified regions in an image.


## SYNOPSIS
       **pamgetcolor  **[**-format  _**format_]  [**-radius _**radius_] [**-linear**] [**-infile _**pamfile_] _region1_ [_region2_
       ...]


## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **pamgetcolor **prints the average colors of a set of circular regions in the input image.

       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 (first row of pixels is row 0; left‐
       most column of pixels is column 0), and _label_ an optional label that **pamgetcolor  **shall  dis‐
       play  to  identify  that region in its output.  All regions have he same radius, specified by
       the **-radius **option.  The region centers must lie within the image, but part of a  region  may
       fall  outside the image; **pamgetcolor **considers only the part that is within the image in cal‐
       culations.



## 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 ]8;;index.html#commonoptions\ Common Options]8;;\ ), **pamgetcolor **recognizes the following command line options:




### -format
              This specifies the format in which to output the  colors.   The  output  is  always  a
              ]8;;libppm.html#colorname\Netpbm color specification]8;;\ ; 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  by  _param_.   Example:
              **rgb-255:255/128/64 **This 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/.25 _**param_
              specifies precision as the number of digits in the fractional part.

       x11    Samples are hexadecimal numbers with _param_ digits, e.g. **rgb:01/ff/8000**



### -radius
              sets the radius of the regions.  A value of zero causes **pamgetcolor **to measure a  sin‐
              gle 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  tells  **pamgetcolor  **to 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.




## SEE ALSO
       [**pnmcolormap**(1)](https://www.chedong.com/phpMan.php/man/pnmcolormap/1/markdown),



## AUTHOR
       This program was first submitted by Anton Shepelev (<_anton.txt@gmail.com_>).


## HISTORY
       This program was new in Netpbm 10.83 (June 2018).


## Table Of Contents
       •

              ]8;;#synopsis\SYNOPSIS]8;;\

       •

              ]8;;#description\DESCRIPTION]8;;\

       •

              ]8;;#examples\EXAMPLES]8;;\

       •

              ]8;;#options\OPTIONS]8;;\

       •

              ]8;;#seealso\SEE ALSO]8;;\

       •

              ]8;;#author\AUTHOR]8;;\

       •

              ]8;;#history\HISTORY]8;;\

## 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>**

netpbm documentation                         18 May 2018                  _Pamgetcolor_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
