Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
BWMOD(1)			    BRL-CAD			      BWMOD(1)

NAME
       bwmod - arithmetically modify pixel values in black and white bw	file

SYNOPSIS
       bwmod [-c] [-a add -s sub -m mult -d div	-A -e exp -r root...] .	_
	     file.bw

DESCRIPTION
       Bwmod will perform a series of arithmetic operations on each 8-bit
       pixel of	its input/output stream. This is a bw(5) file format. The
       pixel values range from 0 to 255	and are	internally operated on in
       floating	point form (unless the -c option has been specified) so	that
       dynamic range, truncation, and sign, are	not a problem. On output they
       are converted back to 8-bit unsigned values clipping to 0 and 255 if
       necessary. The number of	pixels clipped high and	low, if	any, are
       reported	to standard error on completion.

       If the -c option	is specified, then intermediate	results	are stored as
       signed characters, though the command line arguments remain in floating
       point format. This is useful when one wishes to take advantage of
       wrap-around characteristics of binary mathematics.

       Any number of operations	can be given and they are applied in order.
       The choices are:

       -a val to add a value.

       -s val to subtract a value.

       -m val to multiply by a value.

       -d val to divide	by a value.

       -A to take to absolute value of each pixel.

       -e val to exponentiate, i.e. raise each pixel to	the power val.

       -r val to take the val root of each pixel.

       All arguments can be floating point values. Note	that this command can
       be applied to color pix(5) files	also, but no distinction can be	made
       between color planes.

EXAMPLES
       The command

       bwmod -m-1 -a255	< file.bw > file2.bw will produce the negative of a
       file by first multiplying by minus one, and then	adding 255 to shift
       the pixels back into the	0->255 range.

       One can apply a gamma factor to a file as follows:

       bwmod -d255 -r2.2 -m255 < file.bw > file2.bw which will first normalize
       the pixel values, then take the 2.2 root	of each	pixel, and finally
       scale it	back to	0->255.	[Note however that applying gammas this	way is
       not recommended since a function	call per pixel results!]

       Suppose you ran bwstat on a file	and found min=80, max=210, mean=100.
       If you wish to expand the range of intensities, while still preserving
       the mean, this can be done by: bwmod -s100 -m1.409 -a100	< file.bw >
       file2.bw	Where 1.409 results from (255-100)/(210-100) which is what one
       would use by boost the max value	(210) to full scale (255) after
       subtracting the mean (100). Subtracting and adding 100 make the
       multiply	occur "about that point", i.e value less than 100 will get
       smaller;	those above, higher.

SEE ALSO
       brlcad(1), pix(5), bw(5)

AUTHOR
       BRL-CAD Team

COPYRIGHT
       This software is	Copyright (c) 1989-2013	by the United States
       Government as represented by U.S. Army Research Laboratory.

BUG REPORTS
       Reports of bugs or problems should be submitted via electronic mail to
       <devs@brlcad.org>.

BRL-CAD				  07/08/2017			      BWMOD(1)

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | SEE ALSO | AUTHOR | COPYRIGHT | BUG REPORTS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=bwmod&sektion=1&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help