home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / w / widget5 / !Widget5 / !Help next >
Encoding:
Text File  |  1995-05-06  |  14.2 KB  |  391 lines

  1. Instructions for !Widget5 by Andrew Sellors
  2.  
  3. *****************************************************************************
  4. * NOTE:                                                                     *
  5. * !Widget5 is FreeWare.                                                     *
  6. * This means that you may freely copy and distribute it, provided that it   *
  7. * is complete with all original files, and that you do not sell it.         *
  8. * PD libraries may charge a nominal fee for the cost of duplication,        *
  9. * postage etc.                                                              *
  10. * In no circumstances shall the author be liable for any damage, loss of    *
  11. * profits, time or data or any indirect or consequential loss rising out of *
  12. * the use of this software or inability to use this software.               *
  13. *****************************************************************************
  14.  
  15. Contents:
  16. ~~~~~~~~~
  17.  
  18. About Widget 5
  19. Compatibility
  20. Operation
  21. Adding you own pre-defined filters
  22. Setting the 3D bit
  23. Contacting the author
  24.  
  25. ********************************************************************************
  26.  
  27. About Widget 5:
  28. ~~~~~~~~~~~~~~~
  29.  
  30. * Widget 5 is a 256 grey level image processing package for square pixel Sprites.
  31.  
  32. * Widget 5 will work with any size of image, memory permitting.
  33.  
  34. * Widget 5 loads any file as a 256 grey level image, disregarding any palette.
  35.   (Useful for owners of the Brainsoft video digitizer)
  36.  
  37. * Images are stored in 6 separate "Image Banks" in memory.
  38.  
  39. * Widget 5 can be run in any screen mode, but those which have 256 grey levels
  40.   in the palette will result in the best images.
  41.  
  42. * Widget 5 supports the following image manipulation functions:
  43.  
  44.      * Add two images
  45.      * Average two images
  46.      * Mix two images
  47.      * Convolve an image to another using a 3x3 matrix
  48.      * 3x3 median filter an image
  49.      * Changing image greylevels by:
  50.                  * Drawing the mapping function using the mouse
  51.                  * Applying a threshold value
  52.                  * Applying a gamma correction value
  53.                  * Applying histogram equalization
  54.                  * Applying Saturating Linear Contrast Enhancement
  55.      * Scaling an image by resampling using bi-linear interpolation
  56.  
  57. * Widget 5 allows the image to be zoomed using the usual magnifier window
  58.  
  59. * Widget 5 can draw the following graphs from an image:
  60.  
  61.      * Greylevel histogram
  62.      * Cumulative histogram
  63.  
  64. * Widget 5 uses the 3D bit in CMOS RAM to select 2D or 3D windows _and_
  65.   iconsprites on startup. (See the "Setting the 3D bit" section if you don't
  66.   like 2D windows)
  67.  
  68. ********************************************************************************
  69.  
  70. Compatibility:
  71. ~~~~~~~~~~~~~~
  72.  
  73. This program is for RISC OS 3.10 or later.
  74. It has been tested on both RISC OS 3.10 and RISC OS 3.50.
  75.  
  76. ********************************************************************************
  77.  
  78. Operation:
  79. ~~~~~~~~~~
  80.  
  81. NOTE: Clicking on an action icon with Adjust performs the action but leaves the
  82.       window open
  83.  
  84.       If a window contains icons where text can be entered in then pressing the
  85.       RETURN key when in the last icon has the affect of selecting the default
  86.       action button (the one with the yellow border if 3D windows are used).
  87.  
  88. About Image Banks
  89. =================
  90.  
  91. When held in memory, an image is assigned an Image Bank number so that it can be
  92. referenced to for subsequent operations. This is shown on the title of the
  93. image window and also on the menu displayed when the menu button on the mouse
  94. is pressed over an image.
  95.  
  96. Operations chosen from the menu on the image window always use that Image Bank
  97. for the source image.
  98.  
  99. When an image window is closed, the image is discarded from memory and the Image
  100. Bank becomes free.
  101.  
  102. Starting up
  103. ===========
  104.  
  105. The !Widget5 application starts up when you double-click on its filer icon.
  106.  
  107. Creating a blank image
  108. ======================
  109.  
  110. Clicking on the icon bar icon displays the create image window.
  111.  
  112. The size of the image can be changed by typing or using the arrow icons.
  113.  
  114. The radio icons determine which image bank the image is created in.
  115.  
  116. Used image banks icons are greyed out.
  117.  
  118. Loading a file
  119. ==============
  120.  
  121. When a sprite file is dragged to the icon it is loaded into memory and the
  122. place image window is displayed.
  123.  
  124. This allows the image to be placed into one of the Image Banks.
  125.  
  126. Unavailable banks are greyed out, if they are all greyed out then free one of
  127. the banks by closing the window, but remember to save the image first if you
  128. want to keep it!
  129.  
  130. More that one image can be loaded without being placed in a bank, and an image
  131. can be loaded (but not placed) when all the image banks are used.
  132.  
  133. Image menu
  134. ==========
  135.  
  136. Pressing the menu button over one of the Image Banks displays the menu for that
  137. bank. The Image Bank number is repeated on the menu title.
  138.  
  139. The "Info" subwindow shows the size and memory usage of the Image Bank.
  140.  
  141. The "Save" submenu allows the image to be saved as a 256 grey level sprite.
  142.  
  143. The "Process" submenu allows one of the image processing operations to be
  144. selected. These operation will use the Image Bank as source that the menu was
  145. open over.
  146.  
  147. The "Graph" submenu allows graphs to be generated for that particular image.
  148.  
  149. The "Zoom" subwindow allows the size of the image to be changed on screen.
  150.  
  151. Processes
  152. =========
  153.  
  154. Copy:
  155. -----
  156.   This copies the image to another bank.
  157.  
  158. Add:
  159. ----
  160.   This adds the grey levels in the source bank to those in the destination bank.
  161.  
  162. Average:
  163. --------
  164.   This adds the grey levels in the source bank to those in the destination bank
  165.   and then divides by 2.
  166.  
  167. Mix:
  168. ----
  169.   This mixed the image in the source bank with another to produce a third which
  170.   can be placed in the same bank as the second source image.
  171.  
  172.   Clicking on "Start" on the source and destination selection window replaces it
  173.   with a second window containing a horizontal slider. This slider allows the
  174.   proportions of each image (shown below each end of the slider) to be changed
  175.   by dragging the sliderbar.
  176.  
  177.   Normally the resulting image is only created when the "Mix" icon is clicked on
  178.   , but if the destination Image Bank is different from both the source Image
  179.   Banks then the "Real-time" option can be selected. This updates the resulting
  180.   image when the mouse is released from the slider allowing different values to
  181.   be tried out easily.
  182.   
  183. Convolution:
  184. ------------
  185.   This performs a 3x3 convolution using the matrix and anchor point selected.
  186.   The values of the matrix and anchor point can be entered by typing numbers
  187.   into the icons or selecting pre-defined filters from the pop-up menu.
  188.  
  189.   The 3x3 matrix is overlayed on the source pixel (positioned under the anchor
  190.   point) and the overlapping values multiplied and summed together. This sum
  191.   is scaled back down using a automatically generated scale factor, calculated
  192.   from the matrix values, and placed in the destination image as the pixel
  193.   greylevel.
  194.  
  195.   If you want to add your own filters to the menu the read the section titled
  196.   "Adding you own pre-defined filters" further on in this manual.
  197.  
  198. Median Filter:
  199. --------------
  200.   This performs a 3x3 median filter on the source image.
  201.  
  202.   This process takes the source pixel and the surrounding eight pixels and
  203.   places the one with the middle value in the list into the destination pixel.
  204.  
  205.   This is a smoothing process which is particularly suited to removing scratches
  206.   from images.
  207.  
  208. Greylevel Edit:
  209. ---------------
  210.   This allows the greylevels in the source bank to be mapped to different ones
  211.   and the resulting image placed in another bank.
  212.  
  213.   Clicking on "Start" on the source and destination selection window replaces it
  214.   with a second window that performs the actual functions.
  215.  
  216.   The large box shows the mapping function that maps the greylevels in the
  217.   source image (along the bottom of the box) to the resulting image (up the
  218.   side of the box). "0" is completely black and "255" is completely white.
  219.  
  220.   The mapping function can be changed by clicking in the box and drawing the
  221.   line for the new mapping function. When you hold the button down, the
  222.   greylevels in the source and destination images for the current point in the
  223.   box are displayed.
  224.  
  225.   Levels of smoothing can be applied when drawing the mapping function.
  226.     If "Normal Draw" is selected, then only the point in the line where the
  227.     mouse pointer is positioned is affected.
  228.     If either "Smooth Draw" or "V. Smooth Draw" is selected then the points
  229.     near the mouse pointer are also affected, the latter of which producing a
  230.     greater affect. This allows less jagged lines to be drawn.
  231.  
  232.   Various mapping functions can also be selected from the "Processes" pop-up
  233.   menu.
  234.     "Linear" produces a resulting image identical to the source.
  235.     "Invert" produces a negative of the source image.
  236.     "Threshold" makes all the levels below the value black and above white.
  237.     "Gamma" applies gamma correction using the value entered in the submenu.
  238.     "Histogram" applies histogram equalization on the source to give the
  239.        maximum possible contrast.
  240.        contrast.
  241.     "S.L.C.E." applies Saturating Linear Contrast Enhancement on the source to
  242.        enhance the contrast in the image. This looks much better than histogram
  243.        equalization as the resulting image is less harsh.
  244.  
  245.   Selecting "Real-time" results in the destination image being updated after
  246.   every operation instead of just when "Map" is selected. The image is updated
  247.   when the mouse button is released after drawing on the mapping function and
  248.   when any of the processes have been selected.
  249.  
  250. Scale:
  251. ------
  252.   This allows the source image to be scaled by resampling using bi-linear
  253.   interpolation. When an image is enlarged using this process the "blockiness"
  254.   , caused by the pixels being enlarged, is reduced.
  255.   The new size can be selected from either a percentage of the original size,
  256.   "To Fit" a resolution which can be typed in the two icons or to "Custom"
  257.   x and y scaling ratios.
  258.   Be warned however, this can take a while.
  259.  
  260. Graphs
  261. ======
  262.  
  263. The "Greylevel Histogram" graph shows the number of pixels using each
  264. greylevel in the source image.
  265.  
  266. The "Cumulative Histogram" graph shows the total population of pixels in the
  267. source image at and below the grey level shown on the x axis. Thus if the
  268. greylevels are linearly allocated (ie. there is an equal number of pixels
  269. having each greylevel) then the graph is a straight line between the bottom
  270. left and top right.
  271.  
  272. ********************************************************************************
  273.  
  274. Configuration Window:
  275. ~~~~~~~~~~~~~~~~~~~~~~
  276.  
  277. The configuration window can be opened by selecting the "Configure..." entry
  278. from the iconbar menu. The window allows program-wide options to be setup
  279. and the configuration saved so that it is used when the program is next loaded.
  280.  
  281. "Process Destination"
  282. =====================
  283.  
  284. This affect the way the destination banks are picked for the processes.
  285.  
  286. "Only use free banks" only allows you to pick banks that are unused for the
  287. destination image.
  288.  
  289. "Use free or same size banks" allows you to pick banks that are either free
  290. or contain an image that is the same size as the source.
  291.  
  292. "Graph Size"
  293. ============
  294.  
  295. This determines the size of the graphs that are drawn. The large size is ideal
  296. for 17" monitors.
  297.  
  298. "Draw action"
  299. =============
  300.  
  301. These determine the default selection of the draw action options in the
  302. greylevel edit process window when it is displayed.
  303.  
  304. "Update"
  305. ========
  306.  
  307. This determines the default selection of the "Real-time" option when the
  308. process windows that use it are displayed.
  309.  
  310.  
  311. Clicking on "Change" applies the changes made and closes the window.
  312.  
  313. Clicking on "Cancel" forgets the changes made and closes the window.
  314.  
  315. Clicking on "Save" applies the changes made and saves the new configuration so
  316. that it is used the next time the program is loaded.
  317.  
  318. ********************************************************************************
  319.  
  320. Adding you own pre-defined filters:
  321. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  322.  
  323. Extra filter matrices for the "Pre-defined filers:" menu in the convolution
  324. process window can be added by editing the "Messages" file, found inside the
  325. !Widget5 directory. (the directory can be opened by double clicking on the filer
  326. icon whilst holding the SHIFT key)
  327.  
  328. Located near the end of the file is a line that starts "menu.filter:". This
  329. contains a comma separated list of all the filter names that appear in the menu.
  330. Below this is a list of lines that start "filter.N:" (where N is a number) that
  331. define the matrices corresponding to the names on the menu. The value of "N"
  332. determines which entry in the menu the matrix goes with, "filter.0:" is the
  333. first entry.
  334.  
  335. To add a new filter, add the name to the list in "menu.filter:" and then add
  336. the matrix description using a correctly numbered "filter.N:" line.
  337.  
  338. The first two values in the "filter.N:" line are the anchor point and then
  339. following are the matrix values, row by row, starting with the top left value.
  340.  
  341. Make sure that there are enough "filter.N:" lines for entries in the menu.
  342.  
  343. ********************************************************************************
  344.  
  345. Setting the 3D bit:
  346. ~~~~~~~~~~~~~~~~~~~
  347.  
  348. If you want to use the 3D windows in this program (and the handful of others
  349. that support it) then you need to set the 3D bit in the CMOS RAM.
  350.  
  351. !Configure in RISC OS 3.5 allows you to change this, it is the called "2D window
  352. tools" in the "Window manager" window and should be off to have 3D windows
  353. (which is where it normally is).
  354.  
  355. In RISC OS 3.1 the only way to do this is either:
  356.  
  357.    Use !DeskCtrl (another program I have written, well worth getting and
  358.                   hopefully released soon on the Acorn User coverdisc)
  359.  
  360.    OR
  361.  
  362.    By cutting out the following BASIC program and running it.
  363.    Note: this program toggles the bit, so if its off and you run it twice then
  364.          it is still off!
  365.  
  366.     10REM Toggle state of '3D look' bit in CMOS
  367.     20REM Read byte
  368.     30SYS "OS_Byte",161,140 TO ,,byte%
  369.     40REM EOR byte with mask for bit 0
  370.     50byte% - byte% EOR 1
  371.     60REM Write byte back again
  372.     70SYS "OS_Byte",162,140,byte%
  373.     80END
  374.  
  375. ********************************************************************************
  376.  
  377. Contacting the author
  378. ~~~~~~~~~~~~~~~~~~~~
  379.  
  380. I, Andrew Sellors, can be contacted either at
  381.    57 Boundaries Road
  382.    Feltham
  383.    Middlesex
  384.    TW13 5DR
  385.  
  386. Or via Internet email at
  387.    k946949@king.ac.uk
  388.  
  389. Any feedback from users (bugs reports, requests for new features, praise,
  390. money etc.) is gladly received.
  391.