Pamthreshold User Manual(0)                        Pamthreshold User Manual(0)





NNAAMMEE
       pamthreshold - threshold grayscale image to black and white


SSYYNNOOPPSSIISS
       ppaammtthhrreesshhoolldd [--ssiimmppllee] [--llooccaall==_w_i_d_t_hxx_h_e_i_g_h_t] [--dduuaall==_w_i_d_t_hxx_h_e_i_g_h_t]
       [--tthhrreesshhoolldd==_t_h_r_e_s_h_o_l_d] [--ccoonnttrraasstt==_t_h_r_e_s_h_o_l_d] [_i_n_p_u_t_p_a_m_f_i_l_e]

       Minimum unique abbreviations of options are acceptable. You may use
       double hyphens instead of a single hyphen to denote options. You may
       use white space in place of the equals sign to separate an option name
       from its value.


DDEESSCCRRIIPPTTIIOONN
       This program is part of NNeettppbbmm(1).

       ppaammtthhrreesshhoolldd thresholds a grayscale image. Thresholding means dividing
       the image into background and foreground by comparing every pixel to a
       thresholding value.

       The input should be a PGM image or a PAM image of tuple type GRAYSCALE
       or GRAYSCALE_ALPHA.  However, pamthreshold doesn't check; it just
       thresholds the first channel as if it were grayscale samples and if
       there is a second channel, processes it as if it is a transparency
       (alpha) channel.  So if you feed it e.g. a PPM image, it will work but
       produce probably useless results.

       The output is a PAM with tuple type BLACKANDWHITE or
       BLACKANDWHITE_ALPHA, depending on whether the input has a transparency
       channel.  You can turn this into a PBM (if you need to use it with an
       older program that doesn't understand PAM, or you can't afford the 8X
       amount of space that PAM uses for the image) with ppaammttooppnnmm.

       The output is to Standard Output.

       When the input has a transparency channel, ppaammtthhrreesshhoolldd includes a
       transparency channel in the output.  Since the output has maxval 1, the
       transparency channel can indicate only fully transparent or fully
       opaque.  ppaammtthhrreesshhoolldd make it fully transparent where the input is more
       than half transparent and fully opaque where it isn't.

       The transparency function was new in Netpbm 10.43 (June 2008).  Before
       that, ppaammtthhrreesshhoolldd ignores any transparency channel in the input.

       Another way to convert a grayscale image to black and white is to
       dither.  Dithering is using clustered black and white pixels such that
       if you step back and look at the picture, you see varying levels of
       gray.  ppaammddiitthheerrbbww does dithering.


OOPPTTIIOONNSS
       Without any options, ppaammtthhrreesshhoolldd uses a method based on the iterative
       algorithm found in the wikipedia <http://www.wikipedia.org/>  article
        _T_h_r_e_s_h_o_l_d_i_n_g _(_i_m_a_g_e _p_r_o_c_e_s_s_i_n_g_)
       <http://en.wikipedia.org/wiki/Thresholding_%28image_processing%29>  to
       compute the thresholding value.  ( this version
       <http://en.wikipedia.org/w/index.php?title=Thresholding_%28image_processing%29&oldid=132306976>
       of the Wikipedia article was current at the time of this writing).  It
       uses this threshold to globally threshold the image.  This should work
       well for most images.  The program issues a message telling you what
       threshold it used.  (Netpbm messages go to Standard Error, and you can
       turn them off with the Netpbm common option --qquuiieett).

       Options --ssiimmppllee, --llooccaall, and --dduuaall select other methods.




       --ssiimmppllee
              This selects simple or global thresholding, i.e. ppaammtthhrreesshhoolldd
              compares every pixel to the threshold you specify with
              --tthhrreesshhoolldd.  Those with a brightness greater than or equal to
              the threshold become white; others become black.  This works
              well for black and white text pages scanned with a flatbed
              scanner and is faster than the default method that iteratively
              determines the thresholding value first.


       --llooccaall==_w_i_d_t_hxx_h_e_i_g_h_t
              This selects local adaptive thresholding (also known as dynamic
              thresholding) using the neighborhood which is the square _w_i_d_t_h
              pixels wide and _h_e_i_g_h_t pixels high centered on the pixel in
              question.  ppaammtthhrreesshhoolldd computes the threshold individually for
              each pixel of the image.  This can accommodate changing lighting
              conditions in the image.  Depending on the size of the
              neighborhood this can be quite slow.


       --dduuaall==_w_i_d_t_hxx_h_e_i_g_h_t
              This selects a dual thresholding algorithm using a global
              threshold for low contrast neighborhoods and local thresholding
              otherwise.  This can preserve larger back- respectively
              foreground areas than local adaptive thresholding.  This
              algorithm was proposed in the paper "An Approach To Licence
              Plate Recognition" by J.R. Parker and Pavol Federl.


       --tthhrreesshhoolldd==_t_h_r_e_s_h_o_l_d
              This sets the thresholding value for simple or local
              thresholding.  The value is a floating point number in the range
              [0, 1] directly proportional to the Netpbm sample values, where
              0 corresponds to black and 1 to the maxval of the image.

              If you don't specify this option, ppaammtthhrreesshhoolldd uses a threshold
              of 0.5.

              Without --ssiimmppllee, --llooccaall, or --dduuaall, this option is meaningless.

              The meaning of the threshold depends upon the kind of
              thresholding you do (as determined by other options).  Roughly,
              pixels at least as bright as the threshold become white in the
              output while others become black.


       --ccoonnttrraasstt==_t_h_r_e_s_h_o_l_d
              This sets the threshold to determine if a neighborhood has low
              contrast or not for dual thresholding.  The value is a floating
              point number in the range [0, 1].

              If you don't specify this option, ppaammtthhrreesshhoolldd uses a contrast
              threshold of 0.05.  Without --dduuaall this option is meaningless.





SSEEEE AALLSSOO
       ppaammddiitthheerrbbww(1), ppppmmttooppggmm(1), ppaammttooppnnmm(1), ppaamm(5)


HHIISSTTOORRYY
       ppaammtthhrreesshhoolldd was new in Netpbm 10.34 (June 2006).


AAUUTTHHOORR
       ppaammtthhrreesshhoolldd is Copyright (C) 2006 by Erik Auerswald and released under
       the GGPPLL(1).

DDOOCCUUMMEENNTT SSOOUURRCCEE
       This manual page was generated by the Netpbm tool 'makeman' from HTML
       source.  The master documentation is at

              hhttttpp::////nneettppbbmm..ssoouurrcceeffoorrggee..nneett//ddoocc//ppaammtthhrreesshhoolldd..hhttmmll



netpbm documentation             06 June 2007      Pamthreshold User Manual(0)
