home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / morphpak.zip / MORPH009.ZIP / MORPH.DOC next >
Text File  |  1992-12-09  |  9KB  |  207 lines

  1. MORPH Rel Alpha 0.09 (12/09/92)
  2. Copyright (c) 1992, by David K. Mason
  3.  
  4. This is just a brief intro to get you going with Morph.  It's not
  5. a real document or anything.  Note: this is still a fairly early
  6. alpha version of this program... it's prone to crashing at
  7. inconvenient times, so save your warping meshes in files on
  8. a regular basis.  I haven't worked on this program in quite a
  9. while except to fix one last bug that had been sitting there since
  10. March, and I probably won't get back to it for another long while.
  11. Feel free to report bugs, but don't expect 'em to get fixed too
  12. soon.
  13.  
  14. To run morph, you MUST have:
  15.  1) A VGA monitor (regular VGA is sufficient... morph works only
  16.     in 640x480x16 mode)
  17.  2) At least a '286
  18.  3) A mouse with a microsoft-compatible driver
  19.  
  20. To accomplish any serious work with this program, you SHOULD have:
  21.  
  22.  1) A numeric coprocessor... it DRAGS without one
  23.  
  24.  2) Plenty of XMS or EMS unless you're working with teeny pictures.
  25.     During the warping process, morph creates a buffer
  26.     big enough to hold one entire picture, in RGBa (32-bit)
  27.     form.  That means 256000 bytes if you're working with
  28.     320x200 pictures, or 1,228,800 for 640x480, or 1,920,000
  29.     for 800x600, or 3,145,728 for 1024x768.
  30.  
  31. To get started with Morph, type "MORPH <file1> <file2>".
  32. The files can be TGA (16, 24, or 32, compressed or uncompressed),
  33. Vivid IMG, or GIF.  The two files don't have to be in the same
  34. format, but they do have to have the same dimensions.
  35. Morph doesn't currently check to make sure they have the same
  36. dimensions, so if you mix 'em up, you might get REAL odd results,
  37. run-time error, or both.
  38.  
  39. The only type of output Morph creates is compressed Targa-32
  40. files.  VPIC and PICLAB have some trouble reading the output files,
  41. because the run-length packets span lines.
  42. DTA can read 'em okay, though.
  43.  
  44. Morph will then read and display the two pictures in side-by-side
  45. windows.  If you only gave one filename, then it'll display
  46. that picture twice.
  47. It scales 'em so they'll fit in the windows.
  48.  
  49. Then, a mesh is laid over the two pictures.
  50. In this program, a mesh is represented by a bunch of horizontal
  51. and vertical lines.  The points where they intersect can be
  52. adjusted.
  53. Initially, there are lines on the four edges of the picture,
  54.  
  55. There are always the same number of mesh points defined in the
  56. two pictures, though they aren't always in the same places
  57. unless the meshes are locked.
  58.  
  59. To add a new line to the mesh, move the mouse cursor to the
  60. border around one of the pictures (which one doesn't particularly
  61. matter).  Click the button at the point where you want the line
  62. added.  (If the cursor is on the top or bottom border, a vertical
  63. line will be added, and if it's on one of the sides, a horizontal
  64. line will be added.)
  65.  
  66. To move a vertex, put the mouse cursor over the intersection
  67. of two lines, press the button, and move the mouse.
  68. Let go of the button when you've got the point where you want
  69. it.  Morph will try to prevent you from overlapping lines.
  70. It's possible to defeat it with weird angles.  It's best if
  71. you don't, however.
  72.  
  73. Here's what the other controls on the screen do:
  74.  
  75.  Morph/Warp:  In Morph mode, the program will map points from
  76.    picture #1 toward picture #2, and from 2 toward 1, and
  77.    cross-fade.  In Warp mode, it'll just map points from
  78.    #1 toward #2, with no fade.
  79.    Not too surprisingly, Warp mode is takes half the time
  80.    that Morph mode does.
  81.  
  82.  Lock/Unlock:  If lock is selected, the two meshes are
  83.    synchronized.  Move a point on picture #1, and the same
  84.    point in picture #2 will move too.
  85.    If unlock is selected, then the two meshes are independent.
  86.    I tend to keep the meshes locked at the beginning, while
  87.    I'm setting up points for picture #1.  Then unlock and
  88.    move the points on picture #2 around.
  89.  
  90.  Spline meshes:
  91.    When your points are all located where you want them to be,
  92.    and you tell Morph to go ahead and morph, Morph figures out
  93.    which points to map where by drawing spine curves between
  94.    the vertices.
  95.    If you turn this control off, it'll draw straight lines instead.
  96.    Reasons to use slines instead of lines: the warp often looks
  97.    a whole lot better.
  98.    Reasons to use lines instead of splines:
  99.    (1) Splines sometimes go haywire, with curves going every which
  100.        way, overlapping, and (gasp) sometimes even passing beyond
  101.        of the picture borders
  102.    (2) You don't want something curved when it warps
  103.    (3) lines are faster than splines.
  104.  
  105.  Smooth resampling:  In smooth mode, Morph interpolates
  106.    new pixel values from all source pixels that should
  107.    contribute... if you turn this control off, it just
  108.    grabs a the closest pixel value.
  109.    Nearest neighbor, in other words.  The results
  110.    in smooth mode look massively better than dumb mode.
  111.    But dumb mode is massively faster.  Dumb mode would be
  112.    useful in test runs, but don't use it for real stuff, 'cause
  113.    it looks like crap.
  114.  
  115.  Spline intervals: Determines how Morph determines the coordinates
  116.    for the intervals between mesh points.  If this control is on,
  117.    it'll use a spline curve to figure it out.  Otherwise, it'll
  118.    use linear interpolation.  Spline curves often produce
  119.    nicer-looking results, but like with "Spline meshes" they can
  120.    get out of control, and cause terrible streaking in the output
  121.    pictures.  Try splines first, but if you get horrible results,
  122.    turn 'em off.
  123.  
  124.  The Mesh colors "R" control: sets the red component of the color
  125.    used to display the control mesh.
  126.  
  127.  The Mesh colors "G" control: sets the green component of the color
  128.    used to display the control mesh.
  129.  
  130.  The Mesh colors "B" control: sets the blue component of the color
  131.    used to display the control mesh.
  132.  
  133.  The Frames control: tells Morph how many pictures to create.
  134.    If you're in Morph mode, then this represents how many tween
  135.    frames to create.  In warp mode, this number includes a
  136.    fully-warped final frame.
  137.  
  138.  The Splines button: gives you a preview of what splines for the
  139.    current mesh points would look like.  If you're using
  140.    "Spline meshes" mode, make sure you use this button once in a
  141.    while to make sure the splines aren't going nuts.
  142.  
  143.  The Zoom buttons: display just one of the images, much larger.
  144.    This gives much finer control over the mesh control points.
  145.  
  146.  The Save button: saves your meshes and settings to a control file.
  147.  
  148.  The Load button: loads a control file.  Type the filename right the
  149.    first time or you'll get a run-time error and get dumped out to
  150.    DOS.
  151.    The 'L' key does the same thing.
  152.  
  153.  The Go button: causes Morph to start morphing.
  154.    The 'G' key does the same thing.
  155.  
  156.  The Abort button: Changed my mind.  Get me out of this program NOW.
  157.    The escape key does the same thing.
  158.  
  159. If all this makes no sense, just start messing around with the
  160. program.  Once you figure out how to add new points to the mesh,
  161. the rest of the interface is pretty intuitive.
  162.  
  163. Credits:
  164.  
  165. The warping and morphing algorithms come from George
  166. Wolberg's book Digital Image Warping.
  167. The image scaling and spline code come virtually unchanged from the
  168. same book (except for translating it from C to Pascal).
  169. I ripped the line drawing routines off from PC Magazine's
  170. book Turbo Pascal 6.0 Techniques and Utilities, by Neil Rubenking.
  171. I don't remember what other places I stole stuff from.
  172. Much is actually my original work, though.
  173. Thanks to the Compuserve GRAPHDEV forum gang, and the Graphics
  174. Alternative BBS gang for their suggestions, and various bugs
  175. they've helped me identify.
  176.  
  177. Stuff I'm going to add or change (sooner or later):
  178.  
  179. 1) Deletion of mesh lines.
  180. 2) A better way of adding mesh lines.
  181. 3) Proper handling of the alpha channel.  Right now Morph takes
  182.    the alpha byte from TGA-32s into account, but I haven't
  183.    bothered to make it work with them right.
  184.    Since I don't actually have any test files with real alpha
  185.    info in them.
  186.    I'm also going to have to write a little program to add alpha
  187.    info to pictures (a seed fill to alpha out the background
  188.    is a method suggested in Foley & Van Dam).
  189.    And write a program to do compositing (or add that capability
  190.    to DTA).
  191.    By the way, I'm currently going under the assumption that alpha
  192.    represents transparency, not opacity.  (In other words,
  193.    0 means completely opaque, and 255 means completely transparent.)
  194.    That appears to be the more common way of handling the alpha
  195.    byte.  If anybody who reads this knows better, please fill
  196.    me in.
  197. 4) Or, forget that alpha stuff and add some kind of mechanism for
  198.    cropping out the background.
  199. 5) SVGA mode or modes... I'd particularly like
  200.    to do a 1024x768x256 mode, which'd allow two 500x500 (or
  201.    something like that) 64-gray images instead of 300x300 with 8
  202.    grays.  Zoom-in would be REALLY detailed.
  203.  
  204. -- David K. Mason
  205.    P.O. Box 181015
  206.    Boston, MA 02118
  207.