"Personal Paint 7 - 3. The Screen" 3. The Screen The main window of Personal Paint, the requesters associated with painting tools and the file requester are among the most used graphical environments in the program. This chapter describes the functions which can be accessed from these windows. Other windows and requesters, associated with specific settings or functions, are described in chapters "4" to "9". 3.1 The Tool Bar The most used program functions can be accessed directly by clicking one of the gadgets contained in the tool bar. For faster access, the tool bar is located on the left of the screen, just like the default position of images, Amiga Workbench volume icons and the image coordinate system (which all start from the top left of the screen). The function key may be used to alternately remove and redisplay the tool bar. In combination with , which is used to remove the title bar, this command makes it possible to use a larger portion of the screen to actually see and modify the image. All gadgets can be accessed with a single mouse click, but give different results depending on which mouse button is used, and, in some painting tools, whether the mouse pointer is over the upper or lower half of the gadget. Clicking the left mouse button immediately selects the function associated with that gadget, while a click on the right mouse button displays a requester with different program options of that particular tool. Any operation performed with a tool may be undone by clicking on the Undo gadget (section "3.1.10") immediately after the tool action is performed. Appendix "B" lists all keyboard shortcuts to the different tools. 3.1.1 Default and Custom Brushes Whenever a dot, a line or a more complex pattern is drawn on the screen, the program uses the current brush as if it were its "drawing pen". A brush is a small image. Selecting the smallest, pixel sized, brush, is like using a very fine pencil, with which each pixel on the screen can be modified individually. This is the default brush. Working with other brushes is like using thicker tools of different shapes, like a fountain pen, a piece of chalk, etc. The two topmost rows in the tool bar contain brushes of different sizes. There are round brushes, square brushes and brushes which can be user-defined. A brush can be selected with the left mouse button. Using the right mouse button, on the contrary, activates the brush stretch mode (section "5.11.1"). This means that the size of the selected brush can be changed manually by moving the mouse on the drawing area while the left mouse button is pressed. In this way, it is also possible to produce elliptical or rectangular brushes. The <+>/<-> (plus/minus sign) key shortcuts can be used to increase or decrease the size of the brush without leaving the keyboard. A small number, at the beginning of the second row of brush symbols, indicates a previously defined custom brush. Section "3.1.6" explains how to define such a brush. Clicking on the number with the left mouse button selects that brush, just like the other brushes, while the right mouse button activates a small pop-up menu, where it is possible to select the current custom brush among nine different brushes. Once a brush number has been chosen, that brush is used for all paint and brush selection operations. Whenever a different custom brush is selected, the other brushes are preserved intact for future use, and can be reselected at any time. Undefined (empty) custom brushes appear as dot-brushes. It may sometimes happen that a drawing command yields no apparent result. For example, one may wish to draw a line, or paint a dot, but nothing on the screen seems to change. This usually means that the current combination of brush colors and paint mode was chosen to give exactly that result. For example, a brush containing an image entirely drawn in the background color, may become invisible (transparent) in the Matte paint mode (section "5.8.1"). If this occurs, it is sufficient to change paint mode (section "5.8"), or select/define another brush. Chapter "5" is entirely dedicated to brushes, with a detailed description of Personal Paint's original brush handling functions. Section "3.1.6" describes how to define a custom brush. Section "8.6" explains how to merge the color palettes of different brushes into a single, common, palette. Section "8.1.7" describes how to use the brush's palette for the current image. 3.1.2 The Painting Tools Some tools can be used to either draw an outline or a filled shape (e.g. a rectangle, or circle). The symbols used for these tools are divided into two halves: the upper half of the gadget is used to select the outline function, and the bottom part for the fill mode. Pressing the left mouse button activates the selected drawing mode, whereas the right mouse button usually activates a requester with several options associated with the tool. The upper/lower half distinction also applies to right mouse button selections: different requesters (e.g. line vs. area settings) may be associated with each half of the gadget. If the key is held down during a painting operation, the tool can be positioned only vertically or horizontally, i.e. in the direction the mouse pointer is first moved after pressing . While a mouse button is held down (e.g. to define a brush), cursor keys can be used to scroll the image, and Magnify Mode can be switched on and off using the keyboard shortcut (default = ). In animation mode, it is possible to switch to the previous or next frame while a painting tool is in use. 3.1.2.1 Dotted Freehand This is the simplest painting tool. When it is active, the current brush is used to "paint on the screen" whenever the left or right mouse button is pressed. If the left button is pressed, the brush is "pasted" onto the image. The resulting color and shape also depend on the current paint mode (section "5.8"), stencil (section "8.2") and transparency (sections "5.9.5" and "9.14.3"). If the right mouse button is pressed, the brush is drawn using the current background color. The foreground and background colors can be selected from the palette below the tool bar with the left and right mouse buttons, respectively, as explained in section "3.1.11". If the mouse is moved quickly while a button is held down, several "dots" are painted. The distance between the dots depends on the speed at which the mouse is moved, as well as the computer's processing power. A faster computer will be more efficient at "catching up" with the mouse pointer. Personal Paint does not try to reconstruct the mouse's path. A separate function is provided for this purpose, as described in the following section. 3.1.2.2 Continuous Freehand This tool is similar to Dotted Freehand, but paints continuously along a path, rather than individual dots. The upper half of the gadget can be selected to draw the simple path, while selecting the lower half causes the path to be filled. If the right mouse button is used to select the upper half of the gadget, the Line Settings requester appears, while the Area Settings requester is displayed if the lower part is selected. These two requesters can be selected and used in the same way in the Curve, Straight Line, Circle, Rectangle, Ellipse and Polygon tools. The two program environments (section "4.8") have independent Line and Area Settings. 3.1.2.2.1 Line Settings The Continuous option in the requester is the default operating mode of Personal Paint: straight lines, borders and arcs are drawn continuously. The On-Off and Color Pattern gadgets, on the contrary, allow for some special effects: if a brush is selected, the pixels of its first (horizontal) row determine the spacing ("pattern") of consecutive brush strokes. In On-Off mode, Beginning on the left of the row, pixels having the background color are interpreted as "don't paint", while non-background colored pixels count as "paint". For example, assuming green as the current background color, a brush having a continuous row of red dots as its first line would have the same effect as selecting the Continuous option, whereas a straight line of green dots would prevent the program from painting at all. The other mode, Color Pattern, is useful for drawing multicolored lines in the Color brush paint mode. The individual colors of the pixels in the first row of the brush determine the actual colors used to draw lines. In the previous example, red would mean "paint in red", and green "paint in green". After the line pattern has been defined, it becomes independent from the brush. This means that the same brush can be redefined without altering the line pattern. 3.1.2.2.2 Area Settings Just as Line Settings allows for some additional freedom in line drawing details, the Area Settings option determines how solid shapes are to be drawn and/or filled. The default Fill Type is Solid: the entire surface is painted with the current foreground or background color, depending on the mouse button which was clicked to start the paint operation. In Gradient mode, the color of filled shapes changes smoothly from the background color to the foreground color. The background and foreground colors (gradient start and stop) can be selected using the right and left mouse buttons to pick a color from the palette. This can also be done while the requester is displayed. Two gadgets give additional control over the gradient fill mode. The left gadgets toggles between Manual and Automatic gradient modes. In manual mode, all colors which appear in the palette range between the background color and the foreground color are used, in the same order as they appear in the palette. In automatic mode, Personal Paint calculates the smoothest transition from the background color to the foreground color, mixing different colors of the palette as appropriate. The right gadget selects the gradient type, i.e. the direction (vertical or horizontal) in which to apply the color transition on the screen, and the start and stop positions for the color range. The types are: Horizontal (based on the width of the object to be filled), Horizontal Image (based on the width of the entire image), Vertical (considers the height of the object to be filled), Vertical Image (uses the the entire image's height) and Shape (starts from the outer borders of the shape to be filled, and goes inwards). The third fill mode is the Pattern fill. A constant pattern is repeated over the entire fill area. The pattern can either be dithered (using any two colors), or selected from one of the custom brushes. In the first case, the two colors, shown in a pair of boxes, may be selected with the mouse from the image or the palette (like the background and foreground colors). A slider indicates the percentage of the second color in the pattern. When gradient rendering is actually performed on the screen (e.g. using the fill tool), it can be aborted by pressing any key on the keyboard. If this is done, the image is not modified by the fill operation, unless Undo (section "3.1.10") is also selected. 3.1.2.3 Curve This tool is used to draw curves which can be bent by moving four reference points with the mouse. When the tool is selected, the initial, straight, line skeleton is defined by clicking a mouse button (left or right, to give a foreground or background colored curve), drawing the line, and releasing the button. The four control points appear as marks at the beginning, middle and end of the curve, and can be grabbed and moved around using the left mouse button. The right mouse button terminates the definition of the curve. Normally, the point closest to the mouse pointer is grabbed when the left mouse button is pressed. If the points are difficult to distinguish, they may be selected individually by pressing a key from to before the left mouse button is pressed. The exact definition of this type of curve is "Bézier cubic section". The four points geometrically define the shape of the curve. The curve starts at the first point, at a tangent to the line from the first to the second point, and ends at the fourth point, at a tangent to the line which joins the last two points. The curve is always enclosed by the convex quadrilateral defined by the points. 3.1.2.4 Straight Line This tool is used to draw simple, straight lines, using the current brush as specified by the line settings. After selecting the tool, the left or right mouse button can be pressed when the pointer is at the desired starting position of the line. While the button is pressed, the mouse can be moved to where the line should end. Releasing the mouse button confirms the line as it appears. The key can be used to draw perfectly vertical or horizontal lines. 3.1.2.5 Circle This tool is used to paint outlined or filled circles. The current brush is used as the "pen", and the line and fill type options (sections "3.1.2.2.1" and "3.1.2.2.2") are applied. The upper half of the gadget selects the outlined circle, while the lower half activates the filled circle. The center of the circle is selected when the mouse button (as usual, left button = foreground color, right button = background color) is pressed. While the button is held down, the mouse can be dragged to indicate the size of the circle. Finally, releasing the button confirms the circle as it is displayed. As with all other painting tools which may affect non-visible parts of the image, the Clip Graphics option (section "9.13.2") determines whether parts of the circle which extend beyond the visible screen area should be drawn or not. 3.1.2.6 Rectangle This tool produces a rectangle, which can either be filled or drawn as a border. The size and shape of the rectangle can be selected by dragging the mouse while the background/foreground color button is held down. 3.1.2.7 Ellipse This tool is similar to Circle and Rectangle, except that an outlined or filled ellipse is painted instead. As with the other tools, the key can be used to restrict the mouse to moving along the vertical or horizontal axis (section "3.1.2"). Similarly, different options requesters (line and fill type) are displayed if the gadget is selected with the right mouse button. 3.1.2.8 Polygon If the upper half of this gadget is selected, the tool behaves like a straight line tool which automatically concatenates lines, thus creating polygonal shapes. After the first corner of the polygon (i.e. set of joined lines) is set by clicking on the left or right mouse button, successive mouse button actions define additional corners. The polygon can be closed by setting a corner next to the origin, or pressing the bar. The outlined polygon does not need to be closed: it can be terminated by selecting any painting tool. If the lower half of the gadget is selected, the polygon is filled after it is closed. 3.1.2.9 Airbrush This is the equivalent of the "real world" airbrush. The painting area is "sprayed" over using the current brush. The background color is used if the right mouse button is selected. Clicking on the Airbrush gadget with the right mouse button displays the Airbrush options. The Shape option is used to select either an elliptical or rectangular airbrush shape. The ratio and size of the ellipse or rectangle can be set manually after selecting the Adjust gadget. This works just like resizing the default brushes (section "5.11.1"). The Jet Count value (which has a valid range from -20 to 1000) indicates the minimum number of "jets" rendered at each mouse movement. A value of zero indicates the default mode (continuous airbrush mode). Positive values may be used to obtain smoother shades (the number of "jets" remains constant, even if the pointer remains still for a long time). If the value is negative, it indicates the delay (in sec/50) between consecutive "jets". Each of the two environments (section "4.8") may have its own, different airbrush settings. 3.1.2.10 Fill This tool fills the painting area starting from the mouse pointer position. The specified color (or pattern) spreads to all areas contiguous to the color clicked on. Beautiful effects can be obtained by changing the default Solid fill mode to a more sophisticated one, as described in section "3.1.2.2.2". The Fill Type requester appears when the Fill gadget is selected with the right mouse button. The fill operation may be interrupted by pressing any key. In this case, the image remains unaffected by the fill command. Selecting Undo after the operation is aborted restores the partial fill. The area to be filled may extend beyond the visible screen limits. The Clip Graphics menu option determines whether the paint command may affect off-screen areas or not. 3.1.3 Text Selecting this tool with the left mouse button activates the Text Editor: the text cursor can be positioned anywhere on the painting area, where it becomes possible to write using the keyboard. The Font Requester is displayed if the tool is selected with the right mouse button (section "3.1.3.2"). 3.1.3.1 The Text Editor The text editing mode begins as soon as the cursor is positioned over the desired spot using the left mouse button. As an aid for exact positioning, the cursor is displayed as a character-sized box, with a horizontal line indicating the baseline. The cursor becomes a flashing bar when writing. During writing, the cursor can be repositioned using the left mouse button, whereas the right mouse button can be used to "grab" and move the entire text just written. The text is treated as a stream of editable characters as long as the text editor remains active and the cursor is not repositioned by using the mouse. After that, the text is "pasted" onto the painting area, and cannot be repositioned or modified with the text editor. It can, however, always be modified using the ordinary paint tools. Personal Paint accepts the standard keys handled by Amiga text editing tools: cursor keys (unshifted or shifted) to move around, to begin a new line, to change the character to the left of the cursor, to delete the current character, + to paste text from the clipboard, etc. Chapter "7" describes in more detail the functions of the Text menu. During editing, it is possible to select a new color from the palette or a new font using the font requester. The entire text can be dragged, using the right mouse button, without interrupting the editing mode. Pressing , or selecting a new tool, terminates the editing session. Personal Paint implements many more text processing functions than other paint programs. Although it is an advanced and complete package, it was not designed to cover word processing requirements. Cloanto's Personal Write is an affordable, fast word processor packed with powerful and original functions. 3.1.3.2 The Font Requester The font requester is used to select the font to be used for text rendering functions. If a new font is selected during text editing, the current session is terminated and a new session, using the selected font, begins at the cursor position. A font is the collection of all the various characters and symbols of a particular type design in a particular size. Fonts may consist of very few special signs, the basic alphabet or even several hundreds of characters. Amiga fonts can be either monochrome or color fonts, and are stored in bitmap or vector format. Vector fonts are more easily scaled to different sizes than bitmap fonts. Bitmap fonts, on the other hand, are generally hand tuned for better results and look better at smaller sizes. Personal Paint can load, scale and use all of these fonts. Font scaling and color fonts have become widely available with version 2 of the Amiga operating system. The font requester is quite similar to Personal Paint's standard file requester (section "3.4"). There is a list of fonts which can be selected using the mouse. A string gadget to the right of the name of the selected font indicates that font's size and attributes. A small window displays some sample text written using the selected font (it is possible to modify the sample text by editing the user interface text file - section "1.14"). The names of the default system fonts (e.g. ROM fonts like "topaz 8 of" and "topaz 9 oetf") may appear even if the specified "Fonts" directory does not contain any font files, as these fonts are always available and usually stored in ROM. The names of already used fonts may also appear, if their bitmaps are still in some system buffers. The font name can be selected with the mouse from the list box. This automatically causes the desired size and style to be selected as well. It is also possible to manually enter this information in the string gadget on the right. This can be particularly useful if no font bitmap file exists for a particular font size and style. If the requested font size does not exist, the Amiga operating system either scales the font to the desired format (in version 2.0 and beyond, only if the "Scaled Font" attribute is specified), or loads the closest existing font. The result of scaling a font to a new format is usually better if the point of departure is a vector font. A second scrollable list contains the different sizes and attributes available for the currently highlighted font. The sample text can be dragged and scrolled with the left or middle mouse button. Like in the file requester, the mouse can be dragged over the list box (which is automatically scrolled) to highlight one item after the other. A cycle gadget allows the user to quickly switch among three different font paths: "FONTS:", "PPaint:fonts" and a user-defined custom path. The three gadgets to the left of the font sample are associated with the bold, italic and underlined attributes. If the selected font is vector-based, or a version of that font having the specified attributes exists, then that font is used, otherwise the style is algorithmically generated (soft style). Style variations may also be selected during text editing, as explained in section "7.5". The remaining font attributes are appended to the number indicating the size of the font, following a widespread Amiga standard. One lower case character is associated with each of the Amiga font attributes. The characters are: Character Attribute u Underlined (no soft style) b Bold (no soft style) i Italic (no soft style) e Expanded r Right to Left f Fixed Pitch t Tall Dots w Wide Dots c Color Font o ROM Font s Scaled Font v Vector Font It may sometimes happen that no custom-designed font bitmap exactly matches a particular font name, style and size. The font handling routines can algorithmically modify an existing font in order to build a font with the desired format. A font generated by such a procedure is flagged with the "Scaled Font" attribute. If it is desirable to build a font in a particular size, rather than using the closest match, an 's' must be appended to the number indicating the size, to enable scaling. For example, if "topaz" and "20 sib" are typed in the Font string gadgets, a stretched ('s'), 20 pixels high, version of the Topaz font is selected, and the Italic ('i') and Bold ('b') soft styles are applied to it. The style gadgets are automatically updated (they could be used to select "Italic Bold" instead of typing "ib"). A particular font may look differently depending on the display mode. For example, it may look "crushed" on an interlaced screen. Starting with version 2 of the Amiga operating system, the 's' option also takes into consideration the current display ratio. For example, a 2:1 pixel ratio would be applied to a "CGTriumvirate 40 s" font in a Hires-NonLaced screen. If Personal Paint's screen mode is changed (e.g. after an environment switch), the ratio of any used vector font is also updated whenever the text tool is (re)selected, or the font requester displayed. The "Vector Font" flag is used to immediately recognize vector font files. When a color font is selected, the displayed sample may not give an exact representation of the original colors, e.g. if the current screen format does not support the font's number of colors. After selecting the font, it is still possible to change the screen format (section "4.5"). The font's color palette can also be restored at any time (section "8.1.8"). Well-written font applications which add or modify Amiga font data automatically update the description of the fonts available for that typeface, which are stored in separate system files. Unfortunately, some programs do not update these information files, so it sometimes happens that these files do not describe the fonts which are really available any more. The Commodore FixFonts program was designed to solve this problem (it can be started by typing "FixFonts" in the Shell). FixFonts should also be used if any font files are renamed, moved, deleted or copied manually using the Amiga Workbench or Shell. 3.1.4 Image Processing This tool is used to select, edit and apply programmable transformation processes (filters) to parts of the picture. With this function it is possible to select with precision the area to be modified. It complements the functions which can be performed on the entire image or brush (sections "4.6" and "5.5"). When the tool is selected once with the left mouse button, the Rectangular Area mode is activated, whereas a second click selects the Freehand Area mode. The area of the screen which is to be processed can be delimited by pressing the left mouse button over the image, moving the mouse to select the outline, and finally releasing the button. If the tool is selected a third time, the area to be processed is delimited by the current brush transparency plane (non-transparent regions are processed), as soon as the left mouse button is clicked when the pointer is over the desired location. When the tool is selected with the right mouse button (or even with the left button, if no effect has ever been selected), the Filter Selection requester is displayed. Effects like blurring are useful to merge new graphic elements or text better with a smooth background picture (e.g. a digitized image). In order not to lose image details, it is possible to mask (section "8.2.3") all the colors in the palette, except those of the elements which are to be integrated: the blur operation will affect only the edges of those items, while the background image will remain intact. Image processing of masked objects also gives nice effects on text strings (e.g. "Edge Detect" gives outlined text, "Dark Vertical" shades the letters, "Randomize" cuts the edges of the letters). Image processing may be stopped by pressing any key on the keyboard. In this case, the Undo gadget can be used to restore the partially processed image. 3.1.4.1 Filter Selection This requester allows the user to define a new filter or select, edit or delete an existing one. The list box contains the names of all the predefined effects. New effects are automatically added to the list as they are defined. Section "9.2" explains how to store selected or all effects for future reuse. To select and use an effect, it is sufficient to double-click on its name, or click once and select Proceed. The New and Edit gadgets respectively open the Edit Filter requester to define a new filter, or modify an existing one. Delete removes an item from the list. Floyd-Steinberg error diffusion may be used to combine the colors in the palette to approximate a particular color. This usually gives smoother color transitions (e.g. in "Dark Vertical Gradient"). If this option is not selected, the best matching single color is used to represent each pixel. Error diffusion is not available for all types of filters. The Cancel gadget at the bottom of the requester undoes any changes made to the image processing settings and cancels the image processing operation. Exit does not perform the image processing operation, but maintains any changes to the settings. 3.1.4.2 Edit Filter New and existing effects may be edited using this requester. The Name string gadget at the top holds the name of the filter being edited, which may be up to 40 characters long. The Kernel, Division Factor and Bias gadgets assume different meanings depending on the filter type. and + respectively move the text cursor to the following or previous string gadget. Convolution is a powerful area process that can be used to sharpen, blur, and modify images. The convolution operation replaces a pixel's value with the sum of that pixel's value and its neighbors, each weighted (multiplied) by a factor. The weighting factors are called the kernel. The kernel matrix is "slid" over each pixel in the image area. For each point, the kernel values are multiplied with the pixel (RGB) values "under" it. The sum of the results is then divided by the Division Factor and added to the Bias value. Finally, the color in the palette which best represents the result is placed at the center of the matrix. The convolution may yield invalid kernel values (negative intensities, or values greater than 255). By default, these are clipped to the valid range. If a negative Division Factor is set, its absolute value is used for processing. This also applies the hue of the current foreground color (and its saturation as well, if the foreground color is the same as the background color) to the result of the convolution. The Bias parameter has a base value and two "modifiers": Bias DeltaX and DeltaY. Bias + DeltaX gives the effective bias value for the rightmost pixel which is processed, whereas the bias for the bottommost pixel is Bias + DeltaY. The bias for intermediate pixel positions ranges between Bias and Bias + DeltaX/Y. DeltaY increments are applied first. To understand this better, it would be interesting to study the result and the settings of the "Light-Dark Oblique Gradient" predefined effect. In the Popularity filter, all pixels corresponding to non-zero positions in the kernel are counted. The most used ("popular") color is then copied to the central pixel. Random filters use the kernel value with the same positional scheme as the Popularity and Convolution process (the center is the current pixel), but the values indicate how likely it is that each pixel-position in the kernel be used for the resulting pixel. A value of 0 means that a pixel would never be chosen. Equal pixel values (e.g. all '1's) would give to each pixel equal chances of being chosen. A value of '2' would mean double probability over a '1', and so on. Dispersed, Clustered and F-S (Floyd-Steinberg) are all black and white (or whatever the current foreground and background colors are) conversion filters. The first two use the Division Factor value to pick a particular size dither matrix Dispersed: 1 = 4x4 matrix, 17 levels 2 = 8x8, 65 levels 3 = 16x16, 257 levels Clustered: 1 = 3x3 matrix, 10 levels 2 = 5x5, 26 levels 3 = 7x7, 50 levels The Dispersed-Dots dithering technique gives good results for video images, while the Clustered-Dots dithering is better suited for higher resolution devices (e.g. laser printers). The Floyd-Steinberg dithering, however, employs error diffusion. All the dithering processes assume that the current background and foreground colors are, respectively, white and black. The brightness of the original pixels is rendered based on this assumption, but any color pair may be selected to achieve special effects. Unlike the color remapping functions of Personal Paint, the error diffusion techniques used for image processing take into account the brightness of the pixels, rather than plain RGB values. 3.1.4.3 Transparency Effects Personal Paint has two image processing effects which can be used to achieve different levels of transparency when copying one object over the other: Environment Transparency and Brush Transparency. Brush Transparency includes a special alpha channel mode. In all cases, the current image is always the one which is modified by the effect (i.e. it is the target image). Environment Transparency uses the other environment as the source, while Brush Transparency uses the current brush (and the following brush, in alpha channel mode). Brush Transparency feels more intuitive after toggling the Image Processing tool on the tool bar to the third position (brush mode, section "3.1.4"). Using the mouse, the brush can then be "pasted" over the image, with a variable degree of transparency. If the brush image processing mode is combined with the Environment Transparency, it is possible to create a "Rub Through" effect, as if a brush-shaped hole perforated the current image, making it possible to look into the other environment. This is one of the predefined effects, and is great for progressively bringing up details in animations. Since transparency effects tend to create a lot of new colors, it is recommended to activate the "F-S Error Diffusion" option in the Filter Selection requester. Like all other effects, the predefined filters can be modified, and new filters can be defined. The Kernel and DivFactor parameters of the filter are ignored, while Bias is used to adjust the degree of transparency of the source image (-1 = alpha channel mode, 0 = complete transparency, 255 = no transparency). The Rub Through effect has Bias set to 255 (i.e. the source image is copied over the destination image "as is"). The Bias DX and DY values specify the horizontal and vertical transparency transition, as described for other filters (e.g. Light-Dark Oblique Gradient). 3.1.4.4 Alpha Channel The alpha channel is a special feature which is available with Brush Transparency effects. The alpha channel mode is activated by setting the Bias value to -1, and requires two consecutive brushes rather than one. In this mode, the degree of transparency of each pixel in the brush is a function of the brightness of the corresponding pixels in the second brush, rather than being defined by the plain Bias value. The additional transparency information provided by the second brush is called alpha channel. This data is very useful, for example, to create and manipulate images which must remain antialiased regardless of the background. White pixels in the second brush correspond to complete opacity, while black and undefined pixels indicate full transparency. Example. Suppose you want to paste down a brush which is solid in the center and gradually becomes more transparent towards the edges. The alpha channel brush would reflect this and can be created using a gradient fill, white in the center fading to black around the edges. Single-brush alpha channel is also possible. This mode is associated to a Bias value of -2, which indicates "Same Brush" alpha channel. This mode applies the transparency information provided by the brush on the brush itself. For this reason, this option works best with the Color Paint Mode (rather than Matte or Replace). 3.1.4.5 Stereograms What is a single image stereogram? It is a single picture containing different information for the left and right eye. When the eyes look at the picture "normally", the hidden clues cannot be recognized. However, when each eye looks at a different spot on the picture (which is what happens when the eyes pretend to look at an object positioned before or beyond the picture), after some adjusting, matching patterns can be recognized. Acting on eye convergence and divergence, the differences in the pattern provide the brain with depth information. 3.1.4.5.1 How to Create a Stereogram To generate a stereogram, you need to use both program environments: one to provide depth information and one to render the actual stereogram. Stereogram animations are also possible. If you select the Pattern stereogram type (SIPS) instead of the Random Dot type (SIRDS), you need to store a tile-pattern in the current brush. In single image stereograms, the "hidden image" is defined by different levels of depth. The 3D image does not have its own colors: it consists of depth information only. It does however inherit the texture of the "container" image, where very creative combinations of colors and patterns can be used. In the pattern type of stereograms, for example, a pattern can be used to create a forest or a sea, where the 3D shapes can be concealed. Depth information is provided by shapes drawn in different levels of gray. Simple shapes are normally easier and quicker to recognize. If text needs to be written in the hidden image, sans-serif, extra bold type is usually more readable. Black indicates the "most elevated" (closest) level, white corresponds to the "deepest" (farthest) level, while "flatness" is associated to a 50% gray (in the Palette requester: H=0, S=0, V=50%). This is the level which is not distorted when using pattern stereograms. Note that "front" and "back" are subjective, and can be reversed depending on the technique used for viewing the image: cross-eyed or parallel style. Extreme depths, such as those associated to black and white, are not necessarily the easiest to recognize. To the contrary. Highest quality is usually provided by intensities closer to medium levels of gray. For a quick test, draw a black box on a 50% gray background. Then go to the other environment, choose an appropriate screen mode (having the same size as the screen containing the black box) and color palette, select Image Processing from the Project menu and select one of the Stereogram filters. SIRDS (Random Dot Single Image Stereograms) are constructed using random dots, whereas SIPS (Single Image Pattern Stereograms) use the current brush to create a pattern. Personal Paint will render the stereogram in the current environment. Different variants of predefined filters are provided: High Quality filters produce stereograms which are easier to recognize, whereas the More Levels filters are capable of rendering more detailed depth variations (up to 256 levels, associated to gray shades ranging from white to black). The pattern used for SIPS stereograms should be as "fractal" as possible. Smooth color transitions and wide areas of the same color should be avoided. The more color-information per unit of length, the stronger the illusion will be. Since the patterns are slightly distorted to render the stereogram, patterns which are naturally irregular (such as leaves, waves, grass, marble, etc.) tend to be more suitable than other (more geometrical) shapes. Of course it is possible to retouch the resulting stereogram, or paste it into another picture, to create something like a beach with a shark hidden underwater. Help symbols can be placed automatically on stereograms. By default, these are constructed by drawing small squares on top of the image, but they can easily be replaced by pasting a custom brush over the square. For convenience and maximum accuracy, the squares have an odd pixel size, so that in Magnify mode the brush handle can quickly be positioned over the central pixel of the box. Technically, stereograms are created by constructing vertical columns of almost identical patterns. When the eyes are crossed or widened as required to view single image stereograms, each eye focuses on a different column. The difference between the repeated patterns is very similar to the difference perceived by the eyes when looking at an object in the real world. What makes stereograms particularly interesting from a scientific point of view is that perspective information is not required at all. In fact, people who normally rely on perspective rather than on eye convergence to calculate distances have more difficulties than others when viewing stereograms. The wider the pattern (i.e., the columns), the greater the perceived distance. Too narrow or too wide patterns should however be avoided, since the resulting stereograms are not easy to view (the eyes must be able to cross or widen enough, so that two consecutive patterns overlap). The width of the pattern is determined either by the brush width (SIPS stereograms) or by other filter settings (section "C.1"). In case of SIPS, the current environment should have the same color palette as the brush. For stereograms about as large as a VGA computer screen, 8 columns should provide a good quality/contrast compromise. This means that for SIPS stereograms the brush width would be 1/8th of the screen width, in pixels. Of course a brush can contain a pattern which is already repeated two or more times in the brush itself. The stereogram cannot render any information in the far left and right of the image. This is because there can be no overlapping of patterns when one eye approaches the left or right edge, since the other eye would look outside the image. The complexity, and most of the compromises of computer generated stereogram generation are caused by the fact that each column forms a pair with both the column to its left and the one to its right. When all this information is overlapped, shadows and echo effects may appear. Personal Paint's filter settings (section "C.1") provide different options to finely tune the creation process. For example, where "ghost" outlines result from very sharp changes in elevation (more likely to occur in SIPS than in SIRDS), flattening the image, increasing the Quality value or activating the Echo Suppression option should help. Echo Suppression works by using random stripes of the pattern as necessary. As a side effect, the hidden shapes may emerge in the final image. For very small stereograms (e.g. thumbnail format), a High Quality SIRDS style with high contrast image colors (e.g. black and white) could be the best choice, if ease of recognition is a priority. For stereo-animations, SIRDS are usually preferred to SIPS, because large patterns changing position from frame to frame would disturb the viewer. Section "C.1" explains how to change the random seed for SIRDS, or automatically use a new seed for each stereogram. One may think that a constant animation background (as could be provided by using positive BiasDx values) would help recognition of animated stereograms. In most cases, practice has proven the opposite to be true: if the random seed does not change from one frame to the other (and thus the pattern remains constant), the brain becomes able to concentrate on the "tricks" employed to render the stereogram. So it is better to use negative values (i.e. "noisy" background). In any case, creating an animation using a positive random seed value remains an interesting experiment. 3.1.4.5.2 Viewing Stereograms Important: Single image stereograms have recently become very popular through posters and best-selling books (e.g. "Magic Eye", "Stereogram" and "3D Wonderland" series). Personal Paint uses some of the most recent and effective stereogram generation techniques, although the first papers dealing with this subject have been published more than 30 years ago. Since stereograms were first used for scientific visualization and in medical tests, research has been conducted on potential side effects of humans viewing such images. Not only have no harmful effects been discovered, but the techniques used for viewing single image stereograms are also sometimes employed for eye training. While even reading a textbook may cause eye strain and mental fatigue, we believe that it remains prudent to consider that crossing eyes, merging two different views into one and separating focusing from convergence are all actions which do not occur frequently in a natural environment. People with ametropia (e.g. hypermetropia or astigmatism) may tire more easily when viewing these images. Also, some optometrists have advised that people with autonomic ataxia and those at the beginning of farsightedness caused by age should avoid attempting naked eyed 3D viewing. While other methods use polarized light or colored glasses to separate the images, single image stereograms can be seen by focusing on a point which is either between the eyes and the picture (cross-eyed style), or much farther away than the picture (parallel style). Some stereograms can be seen in one of the two styles only. Most stereograms have two reference symbols on top of the picture, to ease proper adjusting. When you stare at the page out of focus, the two symbols may appear as four. This is because the eyes do not converge on the same image, and thus see "double". Now slowly adjust your eyes until the two inner symbols overlap, so that you see a total of three symbols. This is the appropriate convergence to see the stereogram. Slowly move your eyes downwards. You should soon begin to recognize some shapes, which your eyes will be able to focus on. The process can be initiated, for example, either by bringing a finger close to your eyes and moving it, or by imagining to concentrate on something very distant (e.g. mountains or clouds), or by putting the picture to the nose, and then slowly moving it forward, leaving the eyes unfocussed. It is very important that the page be perfectly flat and horizontal. All edges should have about the same distance from your face. Try and resist the temptation to focus on the monitor (or paper). Once the brain begins to merge the two images, focusing will slowly follow automatically. Some people experience more difficulties than others when seeing a stereogram for the first time. Here is what William C. Haga had to say on the Internet: "Being one who has used wide-eyed vision on chain link fences ever since I was a kid, I was able to see the images right away. But I've had difficulty explaining the technique to friends. Today I had the latest Games magazine with me at my parents' house. Games is running another contest using SIRDS, so there are three in the latest issue. This time I thought of the reflection idea. So I opened mom's china cabinet, put the magazine against the glass in the door, and told mom to keep looking at her own reflection in the glass until the image appeared. It took less than thirty seconds. When she saw the 3D train engines, I was subjected to a squeal of delight that I hadn't heard from her for a long time..." 3.1.5 Macros The Macros tool (under the Text tool) can be selected with the right mouse button to select a new Rexx script, or with the left button to repeat a previously selected action. Personal Paint comes with a set of macros which can easily be explored with the About function in the Macro Selection selection requester. Appendix F explains some advanced programming features in more detail. 3.1.5.1 The Macro Selection Requester When the Macro tool is selected with the right mouse button (or with the left button, with no previously selected macro), the Macro Selection Requester appears. The central area of the requester displays the available macros, which are associated to Rexx programs stored in Personal Paint's "Rexx" directory, or elsewhere, if so specified in the program settings. Keyboard shortcuts are shown to the right of the macro names. Four gadgets appear in the upper part of the requester: New, Edit, Delete and About. New and Edit display the Edit Macro requester to respectively define a new macro definition or edit an existing one. Delete removes a macro entry from the list. About displays instructions and other information on the selected macro, if the associated Rexx program contains such data (appearing anywhere in the program, delimited by "/**" and "*/", with an optional three-letter language code after "/** "). More information about the format of the information displayed by the About function appears in the description of the WORDWRAP option of Personal Paint's RequestNotify Rexx command. The Execute, Exit and Cancel gadgets on the bottom of the requester respectively execute the selected macro, or exit the requester leaving any changes to the macros as they are, or cancel all changes and exit the requester. 3.1.5.2 The Edit Macro Requester Personal Paint macros are defined by two sets of information: a Rexx program and the data specified in the Edit Macro requester. The latter is entirely optional, but it is useful to associate an extended name and a shortcut to the Rexx file, and also to access Rexx programs which may be stored in directories other than "PPaint/Rexx". The Name field allows the user to define a name other than the file name. If no name is defined, the file name (without its suffix) appears in the list of the Macro Selection requester. The use of different arguments (see below) makes it possible to have several macros appearing with different names, but referring to the same Rexx program. The Shortcut field is used to associate a keyboard shortcut to the macro. The same format of menu and other shortcuts applies (as used in "UIText.xxx" files). The File field specifies the full path and file name of the macro. By default, Personal Paint macros are stored in the "PPaint/Rexx" directory. This field makes it possible to include macros associated to Rexx programs stored elsewhere, for example in "ColorType:Rexx". The Set gadget displays a file requester, which can be used to define the File information. The Arguments field allows the user to define an optional string which the software passes to the Rexx program upon execution. This string may contain some special codes, introduced by the "%" sign: %p = Name of the Rexx port %n = Macro name (as defined in the Name field) %b = Mouse button pressed (typically in combination with %x and %y): 1 = left, 3 = right. The middle mouse button is not used, as it is associated to the program's "image drag" mode. %x = X-coordinate %y = Y-coordinate %w = Width (relative to %x) %h = Height (relative to %y) When a macro is executed, Personal Paint detects the presence of any %p, %x, %y, %w and %h codes and waits for the user to mark a point or a rectangular region (only if %w or %h are found in the argument string). If the macro is operating in rectangular mode (if %w or %h are used in the argument), then the macro is executed as soon as the mouse button used to define the rectangle is released. Otherwise, the macro is executed immediately. If only %p, %x, or %y are used (that is, no %w or %h), then the macro is executed as soon as the mouse button is pressed (without waiting for the button to be released). This allows the macro to do some work based on the position and the timing of further user actions. In such a case, the LockGUI command should never be used in the Rexx program before the required input is received. When the Rexx program receives the argument string, all "%" codes have already been replaced by Personal Paint with the associated information. In the same way as arguments are normally passed to Rexx programs by the Amiga Shell, Personal Paint passes all arguments as a single string (ARG(1)). It is then up to the Rexx program to parse the string (PARSE ARG