home *** CD-ROM | disk | FTP | other *** search
- Instructions for !Widget5 by Andrew Sellors
-
- *****************************************************************************
- * NOTE: *
- * !Widget5 is FreeWare. *
- * This means that you may freely copy and distribute it, provided that it *
- * is complete with all original files, and that you do not sell it. *
- * PD libraries may charge a nominal fee for the cost of duplication, *
- * postage etc. *
- * In no circumstances shall the author be liable for any damage, loss of *
- * profits, time or data or any indirect or consequential loss rising out of *
- * the use of this software or inability to use this software. *
- *****************************************************************************
-
- Contents:
- ~~~~~~~~~
-
- About Widget 5
- Compatibility
- Operation
- Adding you own pre-defined filters
- Setting the 3D bit
- Contacting the author
-
- ********************************************************************************
-
- About Widget 5:
- ~~~~~~~~~~~~~~~
-
- * Widget 5 is a 256 grey level image processing package for square pixel Sprites.
-
- * Widget 5 will work with any size of image, memory permitting.
-
- * Widget 5 loads any file as a 256 grey level image, disregarding any palette.
- (Useful for owners of the Brainsoft video digitizer)
-
- * Images are stored in 6 separate "Image Banks" in memory.
-
- * Widget 5 can be run in any screen mode, but those which have 256 grey levels
- in the palette will result in the best images.
-
- * Widget 5 supports the following image manipulation functions:
-
- * Add two images
- * Average two images
- * Mix two images
- * Convolve an image to another using a 3x3 matrix
- * 3x3 median filter an image
- * Changing image greylevels by:
- * Drawing the mapping function using the mouse
- * Applying a threshold value
- * Applying a gamma correction value
- * Applying histogram equalization
- * Applying Saturating Linear Contrast Enhancement
- * Scaling an image by resampling using bi-linear interpolation
-
- * Widget 5 allows the image to be zoomed using the usual magnifier window
-
- * Widget 5 can draw the following graphs from an image:
-
- * Greylevel histogram
- * Cumulative histogram
-
- * Widget 5 uses the 3D bit in CMOS RAM to select 2D or 3D windows _and_
- iconsprites on startup. (See the "Setting the 3D bit" section if you don't
- like 2D windows)
-
- ********************************************************************************
-
- Compatibility:
- ~~~~~~~~~~~~~~
-
- This program is for RISC OS 3.10 or later.
- It has been tested on both RISC OS 3.10 and RISC OS 3.50.
-
- ********************************************************************************
-
- Operation:
- ~~~~~~~~~~
-
- NOTE: Clicking on an action icon with Adjust performs the action but leaves the
- window open
-
- If a window contains icons where text can be entered in then pressing the
- RETURN key when in the last icon has the affect of selecting the default
- action button (the one with the yellow border if 3D windows are used).
-
- About Image Banks
- =================
-
- When held in memory, an image is assigned an Image Bank number so that it can be
- referenced to for subsequent operations. This is shown on the title of the
- image window and also on the menu displayed when the menu button on the mouse
- is pressed over an image.
-
- Operations chosen from the menu on the image window always use that Image Bank
- for the source image.
-
- When an image window is closed, the image is discarded from memory and the Image
- Bank becomes free.
-
- Starting up
- ===========
-
- The !Widget5 application starts up when you double-click on its filer icon.
-
- Creating a blank image
- ======================
-
- Clicking on the icon bar icon displays the create image window.
-
- The size of the image can be changed by typing or using the arrow icons.
-
- The radio icons determine which image bank the image is created in.
-
- Used image banks icons are greyed out.
-
- Loading a file
- ==============
-
- When a sprite file is dragged to the icon it is loaded into memory and the
- place image window is displayed.
-
- This allows the image to be placed into one of the Image Banks.
-
- Unavailable banks are greyed out, if they are all greyed out then free one of
- the banks by closing the window, but remember to save the image first if you
- want to keep it!
-
- More that one image can be loaded without being placed in a bank, and an image
- can be loaded (but not placed) when all the image banks are used.
-
- Image menu
- ==========
-
- Pressing the menu button over one of the Image Banks displays the menu for that
- bank. The Image Bank number is repeated on the menu title.
-
- The "Info" subwindow shows the size and memory usage of the Image Bank.
-
- The "Save" submenu allows the image to be saved as a 256 grey level sprite.
-
- The "Process" submenu allows one of the image processing operations to be
- selected. These operation will use the Image Bank as source that the menu was
- open over.
-
- The "Graph" submenu allows graphs to be generated for that particular image.
-
- The "Zoom" subwindow allows the size of the image to be changed on screen.
-
- Processes
- =========
-
- Copy:
- -----
- This copies the image to another bank.
-
- Add:
- ----
- This adds the grey levels in the source bank to those in the destination bank.
-
- Average:
- --------
- This adds the grey levels in the source bank to those in the destination bank
- and then divides by 2.
-
- Mix:
- ----
- This mixed the image in the source bank with another to produce a third which
- can be placed in the same bank as the second source image.
-
- Clicking on "Start" on the source and destination selection window replaces it
- with a second window containing a horizontal slider. This slider allows the
- proportions of each image (shown below each end of the slider) to be changed
- by dragging the sliderbar.
-
- Normally the resulting image is only created when the "Mix" icon is clicked on
- , but if the destination Image Bank is different from both the source Image
- Banks then the "Real-time" option can be selected. This updates the resulting
- image when the mouse is released from the slider allowing different values to
- be tried out easily.
-
- Convolution:
- ------------
- This performs a 3x3 convolution using the matrix and anchor point selected.
- The values of the matrix and anchor point can be entered by typing numbers
- into the icons or selecting pre-defined filters from the pop-up menu.
-
- The 3x3 matrix is overlayed on the source pixel (positioned under the anchor
- point) and the overlapping values multiplied and summed together. This sum
- is scaled back down using a automatically generated scale factor, calculated
- from the matrix values, and placed in the destination image as the pixel
- greylevel.
-
- If you want to add your own filters to the menu the read the section titled
- "Adding you own pre-defined filters" further on in this manual.
-
- Median Filter:
- --------------
- This performs a 3x3 median filter on the source image.
-
- This process takes the source pixel and the surrounding eight pixels and
- places the one with the middle value in the list into the destination pixel.
-
- This is a smoothing process which is particularly suited to removing scratches
- from images.
-
- Greylevel Edit:
- ---------------
- This allows the greylevels in the source bank to be mapped to different ones
- and the resulting image placed in another bank.
-
- Clicking on "Start" on the source and destination selection window replaces it
- with a second window that performs the actual functions.
-
- The large box shows the mapping function that maps the greylevels in the
- source image (along the bottom of the box) to the resulting image (up the
- side of the box). "0" is completely black and "255" is completely white.
-
- The mapping function can be changed by clicking in the box and drawing the
- line for the new mapping function. When you hold the button down, the
- greylevels in the source and destination images for the current point in the
- box are displayed.
-
- Levels of smoothing can be applied when drawing the mapping function.
- If "Normal Draw" is selected, then only the point in the line where the
- mouse pointer is positioned is affected.
- If either "Smooth Draw" or "V. Smooth Draw" is selected then the points
- near the mouse pointer are also affected, the latter of which producing a
- greater affect. This allows less jagged lines to be drawn.
-
- Various mapping functions can also be selected from the "Processes" pop-up
- menu.
- "Linear" produces a resulting image identical to the source.
- "Invert" produces a negative of the source image.
- "Threshold" makes all the levels below the value black and above white.
- "Gamma" applies gamma correction using the value entered in the submenu.
- "Histogram" applies histogram equalization on the source to give the
- maximum possible contrast.
- contrast.
- "S.L.C.E." applies Saturating Linear Contrast Enhancement on the source to
- enhance the contrast in the image. This looks much better than histogram
- equalization as the resulting image is less harsh.
-
- Selecting "Real-time" results in the destination image being updated after
- every operation instead of just when "Map" is selected. The image is updated
- when the mouse button is released after drawing on the mapping function and
- when any of the processes have been selected.
-
- Scale:
- ------
- This allows the source image to be scaled by resampling using bi-linear
- interpolation. When an image is enlarged using this process the "blockiness"
- , caused by the pixels being enlarged, is reduced.
- The new size can be selected from either a percentage of the original size,
- "To Fit" a resolution which can be typed in the two icons or to "Custom"
- x and y scaling ratios.
- Be warned however, this can take a while.
-
- Graphs
- ======
-
- The "Greylevel Histogram" graph shows the number of pixels using each
- greylevel in the source image.
-
- The "Cumulative Histogram" graph shows the total population of pixels in the
- source image at and below the grey level shown on the x axis. Thus if the
- greylevels are linearly allocated (ie. there is an equal number of pixels
- having each greylevel) then the graph is a straight line between the bottom
- left and top right.
-
- ********************************************************************************
-
- Configuration Window:
- ~~~~~~~~~~~~~~~~~~~~~~
-
- The configuration window can be opened by selecting the "Configure..." entry
- from the iconbar menu. The window allows program-wide options to be setup
- and the configuration saved so that it is used when the program is next loaded.
-
- "Process Destination"
- =====================
-
- This affect the way the destination banks are picked for the processes.
-
- "Only use free banks" only allows you to pick banks that are unused for the
- destination image.
-
- "Use free or same size banks" allows you to pick banks that are either free
- or contain an image that is the same size as the source.
-
- "Graph Size"
- ============
-
- This determines the size of the graphs that are drawn. The large size is ideal
- for 17" monitors.
-
- "Draw action"
- =============
-
- These determine the default selection of the draw action options in the
- greylevel edit process window when it is displayed.
-
- "Update"
- ========
-
- This determines the default selection of the "Real-time" option when the
- process windows that use it are displayed.
-
-
- Clicking on "Change" applies the changes made and closes the window.
-
- Clicking on "Cancel" forgets the changes made and closes the window.
-
- Clicking on "Save" applies the changes made and saves the new configuration so
- that it is used the next time the program is loaded.
-
- ********************************************************************************
-
- Adding you own pre-defined filters:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Extra filter matrices for the "Pre-defined filers:" menu in the convolution
- process window can be added by editing the "Messages" file, found inside the
- !Widget5 directory. (the directory can be opened by double clicking on the filer
- icon whilst holding the SHIFT key)
-
- Located near the end of the file is a line that starts "menu.filter:". This
- contains a comma separated list of all the filter names that appear in the menu.
- Below this is a list of lines that start "filter.N:" (where N is a number) that
- define the matrices corresponding to the names on the menu. The value of "N"
- determines which entry in the menu the matrix goes with, "filter.0:" is the
- first entry.
-
- To add a new filter, add the name to the list in "menu.filter:" and then add
- the matrix description using a correctly numbered "filter.N:" line.
-
- The first two values in the "filter.N:" line are the anchor point and then
- following are the matrix values, row by row, starting with the top left value.
-
- Make sure that there are enough "filter.N:" lines for entries in the menu.
-
- ********************************************************************************
-
- Setting the 3D bit:
- ~~~~~~~~~~~~~~~~~~~
-
- If you want to use the 3D windows in this program (and the handful of others
- that support it) then you need to set the 3D bit in the CMOS RAM.
-
- !Configure in RISC OS 3.5 allows you to change this, it is the called "2D window
- tools" in the "Window manager" window and should be off to have 3D windows
- (which is where it normally is).
-
- In RISC OS 3.1 the only way to do this is either:
-
- Use !DeskCtrl (another program I have written, well worth getting and
- hopefully released soon on the Acorn User coverdisc)
-
- OR
-
- By cutting out the following BASIC program and running it.
- Note: this program toggles the bit, so if its off and you run it twice then
- it is still off!
-
- 10REM Toggle state of '3D look' bit in CMOS
- 20REM Read byte
- 30SYS "OS_Byte",161,140 TO ,,byte%
- 40REM EOR byte with mask for bit 0
- 50byte% - byte% EOR 1
- 60REM Write byte back again
- 70SYS "OS_Byte",162,140,byte%
- 80END
-
- ********************************************************************************
-
- Contacting the author
- ~~~~~~~~~~~~~~~~~~~~
-
- I, Andrew Sellors, can be contacted either at
- 57 Boundaries Road
- Feltham
- Middlesex
- TW13 5DR
-
- Or via Internet email at
- k946949@king.ac.uk
-
- Any feedback from users (bugs reports, requests for new features, praise,
- money etc.) is gladly received.
-