blend.sh(1)		      Grass User's Manual		   blend.sh(1)



NNAAMMEE
       bblleenndd..sshh   -  Combines the red, green, and blue color components of two
       raster map layers.
       _(_G_R_A_S_S _S_h_e_l_l _S_c_r_i_p_t_)

SSYYNNOOPPSSIISS
       bblleenndd..sshh file1 file2 perc outbase

DDEESSCCRRIIPPTTIIOONN
       _b_l_e_n_d_._s_h is a Bourne shell (sh(1)) script that extracts	the  red  (R),
       green  (G),  and  blue (B) color components from each of two raster map
       layers, and creates three new raster map layers whose  category	values
       respectively  represent	the  combined red, combined blue, and combined
       green color values from the two input layers.  Category values in  each
       of the output map layers will fall within the range of 0 - 255.


       The  R,G,B  values  from the two input map layers (_f_i_l_e_1 and _f_i_l_e_2) are
       not simply added together, but are instead  combined  by  a  user-named
       percentage (_p_e_r_c) of the R,G,B values in _f_i_l_e_1.	Specifically, _b_l_e_n_d_._s_h
       executes three _r_._m_a_p_c_a_l_c statements that:

	       convert the R,G,B values in _f_i_l_e_1 and _f_i_l_e_2 to the  range  0  -
	      255;

	      multiply	the  R,  G, and B values in _f_i_l_e_1 by a user-named per-
	      centage (_p_e_r_c);

	       multiply the R, G, and B values in _f_i_l_e_2 by (100 - _p_e_r_c)%;

	       create three new raster map layers, whose category values  rep-
	      resent the summed R, summed G, or summed B values resulting from
	      (2) and (3).  Resulting R, G, and B values will respectively  be
	      stored in three new raster map layers named _o_u_t_b_a_s_e.r, _o_u_t_b_a_s_e.g
	      and _o_u_t_b_a_s_e.b.


OOPPTTIIOONNSS
       This program runs non-interactively;  the user must state all parameter
       values on the command line.

   PPaarraammeetteerrss::
       _f_i_l_e_1  Name of a first raster map layer, whose R, G, and B color compo-
	      nents will be combined with those of the second raster map layer
	      (_f_i_l_e_2)  named.	The  percent  value (_p_e_r_c) given will apply to
	      _f_i_l_e_1.

       _f_i_l_e_2  Name of a second raster map layer, whose color  components  will
	      be combined with those of _f_i_l_e_1.	The percent value (_p_e_r_c) given
	      will apply to the R,G,B values in _f_i_l_e_1.	The R, G, and B values
	      in _f_i_l_e_2 will be multiplied by (100 - _p_e_r_c)%.

       _p_e_r_c   Percentage or amount of the color contribution in terms of color
	      intensity.  This value is multiplied  by	the  R,G,B  values  in
	      _f_i_l_e_1.

       _o_u_t_b_a_s_e
	      The  root  name  assigned to each of the three output files cre-
	      ated.  A suffix is added to each	file  name,  indicating  which
	      hold the red, green, and blue color values.


NNOOTTEESS
       _b_l_e_n_d_._s_h  executes  three  _r_._m_a_p_c_a_l_c statements: rr..mmaappccaallcc "_o_u_t_b_a_s_e.r =
       r#_f_i_l_e_1 * ._p_e_r_c + (1.0 -  ._p_e_r_c)  *  r#_f_i_l_e_2"  rr..mmaappccaallcc  "_o_u_t_b_a_s_e.g  =
       g#_f_i_l_e_1	*  ._p_e_r_c  +  (1.0  -  ._p_e_r_c) * g#_f_i_l_e_2" rr..mmaappccaallcc "_o_u_t_b_a_s_e.b =
       b#_f_i_l_e_1 * ._p_e_r_c + (1.0 - ._p_e_r_c) * b#_f_i_l_e_2"



       It uses the # operator to separately extract the red, green,  and  blue
       components  in  the named raster map layers, essentially allowing color
       separates to be made.

EEXXAAMMPPLLEE
       Typing the following at the command line: bblleenndd..sshh  aspect elevation 40
       elev.asp

       will  create  three new raster map layers named _e_l_e_v_._a_s_p_._r, _e_l_e_v_._a_s_p_._g,
       and _e_l_e_v_._a_s_p_._b, that, respectively, contain 40% of the red, green,  and
       blue  components of the _e_l_e_v_a_t_i_o_n map layer and contain 60% of the red,
       green, and blue components of the _a_s_p_e_c_t map layer.

FFIILLEESS
       This program is simply a shell script.  Users are  encouraged  to  make
       their   own   shell   scripts  using  similar  techniques.   See  $GIS-
       BASE/scripts/blend.sh.

SSEEEE AALLSSOO
       _r_._c_o_l_o_r_s,

       _r_._m_a_p_c_a_l_c

AAUUTTHHOORR
       Dave Gerdes, U.S.Army Construction Engineering Research Laboratory

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_1_/_2_5 _0_5_:_4_5_:_3_2 _$



GRASS 5.0							   blend.sh(1)
