


IMSHEAR(1IM)               IMAGE TOOLS               IMSHEAR(1IM)



NAME
     imshear  -  shear an image

SYNOPSIS
     imshear [_o_p_t_i_o_n_s] _i_n_f_i_l_e_n_a_m_e _o_u_t_f_i_l_e_n_a_m_e

DESCRIPTION
     imshear reads each image in the input  file,  shears  it  in
     either  the  X  or Y direction, then writes it to the output
     file.  The input and output image file formats may  be  dif-
     ferent.

OPTIONS
     imshear has a variety  of  options  in  the  following  five
     categories:

          File Selection     What input and output files to use
          Format Selection   What image file format to use
          Format Control     What variant of a file format to generate
          Standard           Standard generic options on all SDSC tools
          Shearing           How the image can be sheared
          Filling            How to fill in blank corners in the sheared image

     _F_i_l_e _S_e_l_e_c_t_i_o_n, _F_o_r_m_a_t _S_e_l_e_c_t_i_o_n, _F_o_r_m_a_t _C_o_n_t_r_o_l, and  _S_t_a_n_-
     _d_a_r_d options are common to all SDSC image tools and are dis-
     cussed in depth in the man page for imconv(1IM).

     All options can be abbreviated to the first few unique char-
     acters.

  Shearing Options
     -xshear _d_e_g_r_e_e_s
          The -xshear option selects the  number  of  degrees  by
          which the image is to be sheared along the X-axis (hor-
          izontal axis).  Degree values may be positive or  nega-
          tive  floating point angles measured relative to the Y-
          axis (vertical axis).  Using the right-hand rule, posi-
          tive  values  rotate  the  vertical  edge  of the image
          counter-clockwise  to  create  a  left-ward  horizontal
          shear.   Negative shear values rotate the vertical edge
          of the image clock-wise to create a right-ward horizon-
          tal shear.

     -yshear _d_e_g_r_e_e_s
          The -yshear option selects the  number  of  degrees  by
          which  the  image  is  to  be  sheared along the Y-axis
          (vertical axis).  Degree  values  may  be  positive  or
          negative floating point angles measured relative to the
          X-axis (horizontal axis).  Using the  right-hand  rule,
          positive values rotate the horizontal edge of the image
          counter-clockwise to create an upward  vertical  shear.
          Negative shear values rotate the horizontal edge of the



SDSC             Last change: November 24, 1992                 1






IMSHEAR(1IM)               IMAGE TOOLS               IMSHEAR(1IM)



          image clock-wise to create a downward vertical shear.

     Shear angles must be between -90 and +90.  However, as shear
     angles  approach  +90  and  -90, the image becomes stretched
     longer and longer and thinner and thinner, image alias arti-
     ficts  become noticable and image dimensions approach infin-
     ity in one direction and 0 in the other.

     If neither -xshear or -yshear are given,  input  images  are
     not  sheared at all and imshear just copies the input images
     to the output untouched.

  Filling Options
     Shearing an image rotates one edge of the image,  but  keeps
     the  other  edge fixed.  The resulting parallelogram has one
     axis-aligned edge  and  one  non-axis-aligned  edge.   Pixel
     storage, however, must be into axis-aligned rectangles (hor-
     izontal and vertical edges only).  So,  imshear  copies  the
     sheared  image into a larger background axis-aligned rectan-
     gle and stores the result to the output file.

     The placement of the sheared image into a  background  axis-
     aligned  rectangular  image  leaves the two triangular image
     corners empty.  These empty corners may be filled in using a
     variety of fill options similar to those found on imfill.

     Fill options allow specific image channels to be filled with
     single values or a range of values in a horizontal or verti-
     cal gradient.

     Fill values are selected using one or more of the  following
     fill options:

          Option              Fill each pixel's
8          _________________________________________
          -red _r_a_n_g_e          red component
          -green _r_a_n_g_e        green component
          -blue _r_a_n_g_e         blue component
8          _________________________________________
          -mono _r_a_n_g_e         monochrome component
          -index _r_a_n_g_e        color index component
8          _________________________________________
          -hue _r_a_n_g_e          hue component
          -saturation _r_a_n_g_e   saturation component
          -intensity _r_a_n_g_e    intensity component
8          _________________________________________
          -alpha _r_a_n_g_e        alpha compoent

     Multiple fill options may be given, as long as color  spaces
     are  not  mixed.   For  instance,  -index  for filling color
     indexes is incompatible with -red for filling the  red  com-
     ponent  of  RGB triplets.  Likewise, -hue for filling pixels
     based upon an HSI color space hue value is incompatible with
     -blue for filling with blue in the RGB color space.  See the



2                Last change: November 24, 1992              SDSC






IMSHEAR(1IM)               IMAGE TOOLS               IMSHEAR(1IM)



     imintro(3IM) man page for a description of the RGB  and  HSI
     color spaces.

     If imshear is directed to fill the  alpha  component  of  an
     image  that does not have an alpha channel, an alpha channel
     is created and initialized to 0s (transparent).

     If imshear is directed to fill a pixel component  that  does
     not exist in the input image (except for alpha), an error is
     reported.

     Input image components not selected for filling  by  a  fill
     option are initialized to zeroes.

     Each of the fill options can accept  an  argument  giving  a
     single  value, or range of values with which to fill.  Value
     _r_a_n_g_e syntax takes any one of the following forms:

          _r_a_n_g_e   Fill with values of
8          ____________________________________________________________
          _n       _n only.
          _n-      _n through the maximum legal value for the component.
          _n-_m     _n through _m.

     There is no space between _n, the dash, and _m.  _n need not be
     a value less than _m.

     When filling with a  single  value,  the  entire  background
     rectnagle is set to the same value.

     When a range of fill values are given, such as -red 0-255 or
     -intensity  0.6-0.2,  the  fill region will be filled with a
     gradation, or ramp, as selected by  the  -graduate  option's
     argument:

          option                 Meaning
8          ____________________________________________________________
          -graduate none         Fill with a constant value
          -graduate horizontal   Fill with a horizontal ramp (default)
          -graduate vertical     Fill with a vertical ramp

     none, horizontal, and vertical may each  be  abbreviated  to
     the fewest unique letters.

     The horizontal ramp for a graduated  fill  starts  from  the
     first  fill  value at the left edge of the image and goes to
     the second fill value at the right edge.  The vertical  ramp
     for  a  graduated fill goes from the first fill value at the
     top edge of the image to the second fill value at the bottom
     edge.

NOTES
     imshear's fill options may used for a  variety  of  effects.



SDSC             Last change: November 24, 1992                 3






IMSHEAR(1IM)               IMAGE TOOLS               IMSHEAR(1IM)



     In  the  simplest  case, the fill options may be set to fill
     the image corners with a color that matches  the  background
     color of the sheared image.

     In a more complex use of imshear's fill options,  the  back-
     ground  corners  may  be  set  to  transparent alpha channel
     values.  Then, using  the  Image  Tools  digital  compositor
     imcomp(1IM),  the  sheared  image  can  be composited onto a
     background image of arbitrary complexity.

     For notes regarding  file  format  conversion  and  standard
     image tool options, see the man page on imconv(1IM).

     Error messages are reported to stderr.

EXAMPLES
     Shear an image 45 degrees along the X-axis:
          imshear image.rgb -xshear 45 sheared.rgb

     Shear the image 45 degrees in the other direction along  the
     X-axis:
          imshear image.rgb -xshear -45 sheared.rgb

     Shear an image 30 degrees along the Y-axis and fill  in  the
     corners with RGB values of (255,255,0) and an alpha value of
     128:
          imshear image.ras -yshear 45 -red 255 -green 255  -blue
          0 -alpha 128 sheared.ras

SEE ALSO
     imcopy(1IM),   imflip(1IM),    imroll(1IM),    imshear(1IM),
     imscale(1IM),       ImVfbRotate(3IM),      ImVfbXShear(3IM),
     ImVfbYShear(3IM)

     For information on SDSC's image library, see imintro(3IM).

     For information on the individual image  file  formats,  see
     their  respective man pages: imbmp (3IM), imcur (3IM), imeps
     (3IM), imgif (3IM), imhdf (3IM), imico (3IM), imicon  (3IM),
     imiff  (3IM),  immpnt (3IM), impbm (3IM), impcx (3IM), impgm
     (3IM), impic (3IM), impict (3IM), impix (3IM), impnm  (3IM),
     imppm  (3IM),  imps  (3IM),  imras (3IM), imrgb (3IM), imrla
     (3IM), imrle  (3IM),  imrpbm  (3IM),  imrpgm  (3IM),  imrpnm
     (3IM),  imrppm  (3IM),  imsynu  (3IM),  imtga  (3IM), imtiff
     (3IM), imviff (3IM), imx (3IM), imxbm (3IM), imxwd (3IM)

AUTHOR
     Chris Groening and Dave Nadeau
     San Diego Supercomputer Center

     See the individual file format man pages for the authors  of
     the  underlying  format  read  and write code.  The names of



4                Last change: November 24, 1992              SDSC






IMSHEAR(1IM)               IMAGE TOOLS               IMSHEAR(1IM)



     these man pages begin with the letters "im" followed by  the
     format  name.  For example, the name of the TIFF man page is
     imtiff.  To display it, enter man imtiff.

CONTACT
     SDSC consultants, (619)534-5100, consult@y1.sdsc.edu

















































SDSC             Last change: November 24, 1992                 5



