Image Outliner

Image Outliner icon


Contents

  • 1. Introduction
  • 2. Using the outliner
  • 3. Improving your results
  • 4. Publisher information
  • Order Now


    1. Introduction

    1.1 Welcome to the Image Outliner

    This Image Outliner software will enable you to convert Sprite (bitmap) files into Draw (vectorised) files. It has been designed carefully to ensure that it is very easy to use by new users, whilst maintaining its powerful features that can be customised by the more experienced user.

    We hope that you enjoy working with Image Outliner and that you find it useful, enjoyable and easy to use.

    The remainder of this introduction explains the difference between a Sprite file and a Draw file and why it is useful to convert from one to the other. If you are familiar with these principles then you may wish to move straight on to the section on installation, called Getting started.

    1.2 Why 'outline' an image?

    There are two different ways in which a computer can store information about a picture: using a bitmap or using vectorised data. RISC OS has two main image formats to represent these, which are known as Sprite files for bitmaps and Draw files for vectorised data. (Sprite files are normally edited using Paint and Draw files are normally edited using Draw.)

    A bitmap is a set of 'dots', in effect, that make up a picture. In its simplest form, each dot is represented by a 'bit' which is either a 0 or a 1. In other words, at each point the dot is either black or white.

    Most of the time the dots are so small that you do not notice that the picture you are looking at is made up of tiny rows of dots.

    The computer remembers the 0s and 1s that make up the picture and, when it comes to display it, it simply puts a black dot where the 0s are and a white dot where the 1s are (or vice versa).

    The alternative is to store details of the points and curves that make up a picture, rather than a dot-for-dot map, and then, when the computer comes to display the picture, it uses the description it has stored to construct the picture in memory, so that it can decide which points should be black and which should be white.

    Bitmap Vector data
    Bitmap Vector data

    Imagine that someone was going to build you a wall. You could draw a picture of the wall, brick for brick, drawing in all the features, or you could leave a note explaining what bricks should be used and what features are required.

    In the first case the builder can just look at the drawing and see exactly what is required, whereas with the description he has to visualise what it would look like by building up the picture in his mind from your description.

    Now the outcome should be the same either way. With the list, the builder has to use his head to work out what the room will finally look like, but in terms of storage it would be much easier, quicker and use less paper to write the list than it would be to draw all of the wall.

    This is similar to the difference between bitmaps and vectorised data. There are obviously several advantages of using vectorised data: the amount of data can often be much less, so the files can be much smaller; the description of how to construct the picture is not dependent on what size the picture was when it was saved, so it can be redrawn at any size without losing detail.

    This means that, whereas a set of dots representing a curve would look very 'blocky' if blown up to ten times its original size, the vectorised line would appear just as smooth. The image can be scaled to any size without loss of detail, so using vectorised data such as a Draw file is an ideal way of making full use of whatever resolution you use to display or print your picture.

    Bitmap Vector data
    Example magnified by 10× (Draw file on the right)

    In addition, the objects making up the image can be manipulated much more easily using Draw than they can as a simple bitmap.

    The best way to see the advantages is to work through the examples in the next section, and see the differences for yourself.


    2. Using the outliner

    This section will show you step-by-step how to convert a Sprite file (bitmap) into a Draw file.

    2.1 Getting started

    In order to use Image Outliner, you should first install it onto your hard drive. This is accomplished simply by dragging the application icon to wherever you wish to store your working copy of the software. Then double-click on the newly-installed copy in order to launch it. There is no need to run the application from the original disc (you can put that away somewhere safe).

    2.2 Choosing a suitable image

    Smaller files, better resolution and easier manipulation are some of the advantages of using Draw files. However, you have to be sure that you have chosen a suitable image which can be represented well as a Draw file.

    Draw files are good for lines and blocks of colour because they are easy to describe using points and curves, but detailed pictures with shading and non-distinct areas are hard to describe with just points, curves and areas of colour. Imagine when you look at a picture that you are going to have to trace the outlines and colour in the areas: if you can't picture it, then it's probably not suitable!

    The following three examples show one image that would trace well, and two that would need to be processed before they could be outlined. (See section 3, Improving your results, for further details on coping with difficult or unsuitable sprites.)

    Examples 1 and 2 are not clear and crisp enough, and it is hard to see where the edges are. In contrast, example 3 has clearly defined areas of colour. Dithered areas are especially bad as they consist of thousands of dots of different colours, each of which would be treated as a separate area.

    Example 1
    Example 1
    Example 2
    Example 2
    Example 3
    Example 3

    It is essential that you understand what sort of images are suitable; otherwise you will spend hours waiting for the software to finish, and the result will be of little use to you. If you have not tried outlining before, some suitable examples are supplied in the 'Examples' directory. (The third example, above, uses the 'Exmp1' sprite.)

    2.3 Loading an image

    To load a sprite, simply drag it from the filer window onto the Image Outliner icon on the icon bar. An Image Outliner window will be opened, with the sprite displayed within it. If the sprite file contains more than one sprite, one window will be opened for each sprite found. Close any of the windows for sprites you don't want to convert.

    Image Outliner main window

    You will notice that the status bar below the window shows you the size of the sprite. This bar shows progress information throughout the various conversion processes, and is a useful means of finding out how far the conversion has progressed.

    If the sprite is too big or too small to be seen clearly, the zoom option can be used at any stage to reduce or enlarge the display of the image.

    Image Outliner is now ready to convert the sprite into a Draw file. This can be done in two ways: straight through the process or by stopping halfway (the latter approach allows you to interact with the conversion process).

    To complete the conversion in one click of the mouse, you would simply click on the Draw icon at the bottom of the toolbox, as shown, and then jump to the section on Saving the Draw file.

    For the purpose of this example we will stop halfway, to explain the various stages in the conversion.

    To start the process, click on the Knots icon on the toolbox, as shown.

    Knot mode selected

    2.4 Scanning the sprite

    The first stage of the conversion is to scan the sprite vertically to identify the edges between each of the colour areas.

    The most common colour found on the extreme edge of the sprite is treated as the 'background colour'.

    Areas of the same colour as the background are ignored, and a rectangular object the size of the sprite is put in at the back of the Draw file (unless this colour is white, in which case there is no need).

    A monochrome sprite needs only a single scan, whereas colour images require an initial scan to find out which colours are present, and where they are, followed by one scan for each colour found.

    Once the outlines have been found, the window clears and the display of the sprite is replaced by that of the outlines.

    2.5 Finding the knots

    Before trying to fit curves to the outlines, Image Outliner must first of all find suitable 'knots', or joining-points, for the curves. It does this by fitting a straight line approximation to the outlines, and then calculates carefully how using fewer and fewer lines affects how closely the approximation line fits the real outline.

    Image Outliner works on one 'path', or continuous line, at a time. The path currently being processed is shown in red: once it has finished, the knots are displayed and the next path is processed.

    The knots are shown as hollow circles or squares: hollow because these are so-called 'potential' knots. This means that, although they have been chosen as likely places for curves to be fitted, the subsequent curve-fitting process will attempt to reduce the number of knots used. (The fewer knots used, the smaller the resulting file size.)

    Circles represent 'smooth' knots, where the curve is supposed to be continuous, while squares represent 'corner' knots, where there is a change of direction. The difference is that, where two curves meet at a smooth knot, they will be forced to have the same tangent, whereas at a corner they will not.

    Fixed knots are represented as solid circles and squares and, if present, will always be included in the final Draw file. These are put in where three colours meet at the same point, and therefore must be a fixed point, to reduce the likelihood of the curve-fitting process overlapping the different areas of colour. They can also be created by editing the knots manually (see Improving your results, later on).

    The process will stop once all the paths have been scanned because you clicked on the Knots icon at the start. Later on in section 3 you will see how it is possible to edit the position and types of all the knots. To continue with the conversion, click Select on the Draw icon on the toolbox.

    2.6 Fitting curves

    The first two stages have identified the paths and processed each one to allocate its share of potential knots. The next stage is to fit curves to each path.

    Image Outliner will try to fit curves between each pair of potential knots, using them as end points. You will also see that it tries to fit curves between all the likely combinations of knots in an attempt to minimise the number of knots used while still getting a good fit.

    (If you choose the Fast option on the Knots submenu, all the potential knots are used, which will speed up the curve-fitting process, but gives a less accurate fit and a larger file size as more knot points are inevitably used.)

    Smooth knots first have a curve fitted through them to determine the tangent at that point, and then the curves that are fitted on either side of that point must use that tangent.

    Corner knots, on the other hand, can have different tangents on either side of them. Once the entire curve-fitting process has finished, the Draw file is displayed in the window.

    Now that the process is complete, you can compare the original sprite with the finished Draw file, by clicking on the Sprite icon on the toolbox and back. By zooming the image to enlarge it, and then clicking back and forth on the Sprite and Draw icons, you can see how much clearer the Draw file looks when it is enlarged, compared with the sprite.

    If you had clicked the right-hand (Adjust) mouse button on the Knots icon of the toolbox, you would have seen the outline on its own. The potential knot-fitting process is deferred, which allows you to specify all the knots yourself if you so choose: if so, clicking Select on the knots icon has no effect. If you click Adjust on the Draw icon, you can see the Bézier curves themselves overlaid on the sprite outline.

    2.7 Saving the Draw file

    To save the resulting Draw file, simply open a filer window and choose the directory you want to use. Then click Menu on the Outliner window, move down to Draw>, then down to Save>, give the file a suitable name and then drag the Draw file icon into the filer window. You can also save a Draw file directly into Draw or a suitable DTP package.

    (A shortcut to this is to click the Menu button with the pointer over the Draw icon on the toolbox, then moving to the Save> option as before.)


    3. Improving your results

    In the previous section we saw how a suitable bitmap image could be converted into a Draw file with a minimum amount of effort. However, this is not always the case, and often it is necessary to improve your image before you convert it.

    3.1 Posterising and cleaning

    'Outlining' an image, to save it and use it as a Draw file, is most effective when the image is clean and contains large areas of solid colour with relatively smooth boundaries.

    If an image is scanned or digitised, this is often not the case, as the image will usually contain dithered* areas to represent certain colours or shading, and the boundaries are often anti-aliased.**

    Posterising

    Image Outliner has a built-in posterising facility which is a means of overcoming the dithering effect.

    By choosing a set of colours, Image Outliner will represent all the existing colours as one of the new smaller set of colours. This is a good way of simplifying an image. Looking at an extreme case, you could choose just black (from a line) and white, and all the other colours would be translated into one or other, producing a black and white image.

    In a colour image you would normally choose four or five colours to represent your image, although you can choose up to sixteen.

    To use posterising you need to be in Sprite mode, with the Sprite button on the toolbox depressed. This is the usual start position when you drop a sprite onto Image Outliner, but if you have been using it and you are at the Knot stage or Draw file stage, you will need to click on the Sprite icon.

    Now simply click on a colour that you want to use, or hold down Select and drag out a box and let go.

    Posterising colours window

    The colour chosen will then be an average of all the colours in the box. You will see a dialogue box appear that shows the first colour you have chosen, and you can now select your next colour by clicking or dragging as before. If you choose a colour you don't want, you can simply click on it in the dialogue box and then click on the bin icon in the dialogue box to delete it. Alternatively, you can change the colour by dragging the red, green and blue bars to new positions. Bin

    If you want to preview what your sprite will look like when it is converted, without committing to the changes, click on the Show icon; this will display your image in its converted form. When you are happy with it, just click on Set and your image will be transformed permanently.

    *Dithered areas occur when two or more colours are arranged in a pattern to represent another colour that is not available in the range of colours. For example, a pattern of alternate black and white dots is often used to represent a shade of grey.

    **Anti-aliasing occurs where the boundary between two areas of colour is 'smudged', using a range of colours between those of the two areas, because the 'real' boundary crosses the middle of the pixels.

    Before After
    Before and after a posterising operation

    Cleaning

    Often, you will find that you are left with areas of one colour dotted with speckles. There are two cleaning routines that run when you click on the Clean option on the menu. The first of these tries to remove single pixels (specks) to overcome the effect of dithering.

    The second sweep does not change anything until it has finished, and is designed to overcome the effects of anti-aliased edges, but may not be suitable, so it is always advisable to save your image before you start, so that you can start again from scratch if you do not like the way you have posterised or cleaned the image.

    If you only want to use the first cleaning routine, you need to wait until the first pass has finished and the second has started, and then click on the Sprite icon on the toolbox again.

    Cleaned Traced
    After cleaning Traced vector image

    3.2 Accuracy settings

    When deciding where to put potential knots on the outlines, and subsequently which potential knots to use in the final Draw file, Image Outliner must decide how tightly to hug the original outlines.

    This is important in deciding the quality of the image: too loose a fit will result in detail being lost, whereas too tight a fit can result in artefacts from the original bitmap being visible in the Draw file.

    Original Tight Loose Right
    Original sprite Too tight Too loose Correct

    Another decision that the computer must make is whether a knot should be 'smooth' or a 'corner': i.e. whether the curve changes direction abruptly or not at a given point.

    All these decisions can be affected by altering the settings of the accuracy dialogue box.

    Accuracy settings window

    This is not as complicated as it may first appear. Each slider bar controls one variable that is used by Image Outliner in the fitting process.

    Straight line looseness

    This is the most important bar, as it determines how tight the original straight line fit should be, which determines the position of the potential knots.

    Moving the bar to the left decreases the tolerances, thereby making the fit tighter and tending to increase the number of knots used. Moving it to the right increases the looseness of the fit, tending to decrease the number of knots used. The fewer knots used to achieve an acceptable result the better, because the resulting file will be much smaller. You will notice that, as you slide the top bar to the left and right, the one underneath it moves too.

    Straight line cutoff

    This slider determines what the maximum acceptable deviation is before straight lines are no longer considered for a given section. Normally this should be set equal to the bar above it, but you will find that if you move it to the left, the fitting will be faster, as fewer lines will be considered. If you move it too far to the left, you will find that the number of resulting knots starts to increase, as lines are not considered because the maximum error is too low.

    The following four sliders in the accuracy dialogue box affect the curve-fitting stage.

    Curve fit looseness

    This controls the tightness with which the curve-fitting needs to match the new curve with the existing outline. Sliding the bar to the left makes the fit tighter, increasing the number of curves used, and moving it to the right makes the fit looser, which decreases the number of curves used.

    Curve fit cutoff

    This acts as a maximum error cutoff point. It is similar to that for the knot-finding. Moving it to the left speeds up the curve-fitting (because fewer long curves are tried).

    If it is set too far to the left then it will start to affect the final result, because the cutoff point will be reached before all the potential curves have been compared.

    Enforce corner knots?

    Decreasing this slider makes it more likely that corner knots will be ignored if a good curve can be fitted through them, while increasing it ensures that corner knots are preserved. If there are many 'false' corner knots, it might be a good idea to decrease this value. If corners are tending to be smoothed out, you should increase this value.

    Use H/V straight lines?

    Sliding this bar to the left makes it more likely that a horizontal or vertical straight line segment will be turned into an actual straight line in the Draw file.

    With the bar to the left, both of these example lines would be turned into straight lines, whereas only the second one would if the bar setting was on the right-hand side.

    If you find that the tops of curves are turning into straight lines, you should move this to the right, whereas if genuine straight lines are turning into curves, you should move it to the left.

    Corner knot angles

    This determines whether a knot is considered to be smooth or a corner. Once the potential knots have been found, the angle between each pair of lines is considered, and knots where the angle is more acute than the corner knot angle are set to be corners, whereas those where the angle is less acute are set to be smooth.

    Creating a corner knot
    An angle of less than 135° produces a corner knot

    To set the angle you can drag the angle indicator bar directly, or click on the up/down arrows (these also auto-repeat if you hold the mouse button down), or enter a new angle in degrees.

    Clicking on the Defaults icon returns all values to their defaults: use the Adjust button if you want the dialogue box to remain open so that you can alter some values.

    Once you have altered the accuracy settings, you need to click the middle (Menu) mouse button on the Image Outliner window and choose Knots>Rescan to get Image Outliner to refit the knots using the new settings.

    3.3 Editing the knots

    Before going on to the more time-consuming process of fitting curves to the outline, it is possible to improve the performance and accuracy of the fit by manually 'tweaking' the knots that the first scan has produced.

    During the knot-fitting process, the toolbox on the left of the window extends vertically downwards to reveal some more icons.

    o  Potential smooth knot
    o  Potential corner knot
    o  Fixed smooth knot
    o  Fixed corner knot
    Knot editing icons

    Adding knots

    The four knot icons on the left (in green) represent which type of knot will be produced if you click on an empty section of curve to create a new knot (they mirror the Knots>Create submenu).

    To add a knot, simply click Select on one of the four green icons on the toolbox and then click on the section of the outline where you require the knot point.

    Moving knots

    Dragging Select or Adjust on a knot will allow you to change the knot's position. The knot can only be dragged along the path it was originally on, and if there are other knots on the path, you can only drag it along the section between its nearest neighbours.

    Editing knots

    Clicking Select on an unselected knot selects it, deselecting any other knots that were previously selected. Clicking Adjust on a knot selects it (if it was not already selected), adding it to the current selection. (If it was already selected it would be deselected.)

    (The Knots>Select submenu is useful for selecting all the knots of a particular type, such as corner knots, so that you can see or edit them more easily.)

    Dragging Select from a point which is not on any path or knot allows a rectangular area to be dragged out. When you release the mouse button, the knots inside the rectangle are all selected. (If you drag with Adjust, all the selected knot points within the resulting box are deselected, and all the unselected knots within the box become selected.)

    Once you have a selection, the four red icons on the right of the toolbox are used to alter the type of all knots that are currently selected.

    (The Knots>Alter submenu also allows knot types to be altered, although that allows the Smooth/Corner and Potential/Fixed knot attributes to be altered separately.)

    The 'bin' icon at the bottom allows the selected knots to be deleted.

    You can start the knot editing while Image Outliner is working on another path, but clicking on the path which is currently being scanned (shown in red) is equivalent to clicking in empty space (the path may not be edited while Image Outliner is working on it).

    Clicking Select or Adjust on an empty section of outline creates a new knot at that position.

    If a path that has not already been fitted has a knot added to it in this way, Image Outliner will not attempt to add any knots of its own to that path.

    Note that, once the curve-fitting has taken place, any knots which were not used are automatically deleted, and the knots which were used are made fixed. If you then return to knot editing mode and edit some knots, then when you click on the Draw icon in the toolbox, only those paths which you have altered will be rescanned.

    This means that you can quickly see the results of moving knots, adding new ones where required, or changing smooth knots to corners and vice versa.

    With practice, it should be possible to edit the knots of each path while Image Outliner is still working on the rest of the image, and by specifying all knots as fixed, the curve-fitting process is made enormously faster and more accurate (if you have chosen your knots well). Images which might take up to an hour to scan in 'automatic' mode can be done in a matter of two or three minutes, and can then be re-tweaked very quickly, if required.

    There are also various keyboard shortcuts. These are all shown on the menu structure in the column on the right of each menu as it appears.

    3.4 Faster processing

    Skilful editing of the knots can enable you to speed up the outlining process quite considerably. You can also turn off the scan-line for the initial scan and clean section, and turn off the status bar and visual curve-fitting, both of which, when disabled, will speed up the process by approximately 20%, but obviously make it less interesting to observe.

    Batch processing and auto-cleaning

    If you have a series of sprites to be processed, you may not wish to sit and process them one at a time. For this reason, Image Outliner has a Batch mode of operation. To set up a batch process, open an Image Outliner window and then move to the Draw>Batch option and drag the icon to the directory you wish to use.

    Setting up a batch operation

    Now, any sprites dropped into the Image Outliner window will be queued, then converted, and the resultant Draw files will be saved in the new directory. The leafnames of the Draw files are the same as the original sprite leafnames, but will be changed automatically if required to avoid overwriting an existing file.

    You can also use batch mode on a sprite that has already been loaded into an Image Outliner window: the fitting process will start automatically.

    If the sprites require cleaning whilst in batch mode, Auto-clean should be selected before starting the batch.

    Suspend and Resume

    When Image Outliner is busy in the middle of an operation you can use the machine for other tasks, as it is multitasking, but you may need to do something that takes a lot of processor power, which is slowed down because of Image Outliner working away in the background. When Image Outliner is running, you will notice that there is an additional option at the bottom of its menu that says Suspend. Choosing this option will suspend the process, freeing the central processor for another task. When you are ready to continue, simply choose the Resume option on the menu, which is just below the Suspend option.


    Order Now


    4. Publisher information

    Copyright © 2003 R-Comp
    All rights reserved.

    Neither the whole or part of the information contained in this guide, nor the software contained on the disc supplied with it, may be adapted or reproduced in any material form or transmitted in any way or form whatsoever except with the prior written approval of R-Comp.

    The information and particulars in this guide are given in good faith. However, R-Comp cannot accept any liability for any loss or damage arising from the use of the software contained on the disc, or any information or particulars in this manual.

    User guide: Second Edition, 2003
    Published by R-Comp
    All trademarks acknowledged.

    R-Comp can be contacted at:

    R-Comp
    22 Robert Moffat
    High Legh
    Knutsford
    Cheshire
    WA16 6PS

    Tel: 01925 755043
    Fax: 01925 757377

    Email: rcomp@rcomp.co.uk
    Web: http://www.rcomp.co.uk/