                             !FadMasks
                             ~~~~~~~~~

                       Fading Mask Generator.
                       ~~~~~~~~~~~~~~~~~~~~~~

	1. General.
        ~~~~~~~~~~
	The purpose of the application is to produce "Fading Masks" for use with image manipulation software, such as PhotoDesk.  A Fading Mask is defined here as one in which the mask is 100% at the outer edge and gradually 'fades' to 0% at some point towards the centre of the image. They can be of various shapes - this application produces Rectangular, circular and eliptical masks.

	The output of this application is not strictly a 'Mask' but a grey scale image from which a mask can be made.  This image may also be directly combined with other images to give various effects (eg. vignetting).

The output is in the form of a Sprite which is 1024 x 768 pixels and always has a size of 788 536 Bytes.  If this is to be kept it should be compressed using !Squash or as a GIF  file (but not as JPEG).  Typical size when compressed with !Squash is 96 kB and as a GIF  95 kB.

	For images smaller than 1024 x 768 pixels the mask should be made to the size required and then cropped. For larger images it is possible to enlarge the mask image within the image manipulation software, which works fairly well.	

For different effects the mask can, of course, be inverted.  Masks generated by this application always have Black at the outside and White at the centre.



	2. Definitions and Generation.
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	2.1 Rectangular Masks.

 The basic geometry is shown in Fig.1 below:-

               Fig. 1 [ FadMasks.Images.HTML_Doc.Pic4 ]
               

                               Page 1




	Outside the thick line , having the dimensions W2 x H2,  the generated mask will be Black.  Between 			

	this and the Inner rectangle, having the dimentions W1 x H1,  there will be a gradual change from 

	Black to White.  This graduation will be Linear.

	The idea is to form a large No. of recrangles between the Outer and Inner Limiting recrangles such that 	each is a shade lighter than the one before it.  We arrange that along the longer (x) axis there are 256 	

	gradations.  Along the shorter (y) axis there will be fewer as some will "overlap".

	OC is a line passing through the corners of all rectangles.  At these points (P2s)  the grey shade derived 	for  points P1  &  P3  should be identical.  However, owing to the fact that the number of 'lines' in the 

	horizontal and vertical directions is not exactly equal, there appear to be light lines along the diagonals. 	When magnified, these 'lines' are seen to be less significant. 

	Figures 2 and 3 below give an idea of what the generated Mask and its inverse look like, although the 

	graduation is, in fact, much smoother.



                 Example 1 - White Centre (as generated)
                 [ FadMasks.Images.HTML_Doc.Pic2 ]
                 
                 
                 Example 2 - Black Centre (after inversion)
                 [ FadMasks.Images.HTML_Doc.Pic1 ]
                 


	2.2  Circular masks.



	The geometry here is simply that of two concentric circles.  Outside the larger is black and inside the 

	smaller is White.  Between are a series of series of concentric circles in shades of grey, the graduation 	

	being Linear.  Since the 'thickness' of each line cannot be smaller than a single pixel, there may be less

	than 254 greys with 'narrow' masks.  For 'wide' masks there will be more than one circle at any shade 

	of grey.  To get exactly 254 greys the 'thickness' needs to be 254 pixels (approx. 2.8 cm when printed 

	at 1:1).   Examples are shown below:-


                                Page 2




         Example 1 - White Centre.		Example 2 - Black Centre.
                      [ FadMasks.Images.HTML_Doc.Pic7 ]
         


	2.3 Eliptical Masks.


	These are similar to the circular masks but, of course, eliptical.  The elipse may have its major axis 

	either horizontal or vertical but if the latter it is restricted to 21.8 cm. (for larger vertical elipses 

	generate horizontally and rotate in an image manipulation application).


	The basic geometry is shown in Fig.2 below:-
           [ FadMasks.Images.HTML_Doc.Pic3 ]
           

	The idea is to form a large No. of ellipses between the Outer and Inner Limiting ellipses such that 

	each is a shade lighter than the one before it.  As with the Rectangular (& Circular) masks, the full 254 	grey gradations will only be realised if the  'thickness' is 2.8 cm or more.

                                 Page 3




        Eample 1  -  White Centre [ FadMasks.Images.HTML_Doc.Pic5 ]
        
        Eample 2  -  Black Centre [ FadMasks.Images.HTML_Doc.Pic6 ]
        
        

	3.0 File Saving.
        ~~~~~~~~~~~~~~~
The resulting Sprite is automatically saved to the Directory containing !FadMasks.  The Filename may be entered by the user.  If no File Leafname is entered the Default Name will be RESULT.  If a File Name, is entered which is already on the Log file, the resulting file will be called DUMP - unless it is already called RESULT.

The Log File is a Text File and may, of course, be "Cleared" by simply erasing all of the text before the "\" , which must be retained (along with the Title).















































										Page 4

