Call Box Editors Manual
Version 1.0 Aug 15,1989


CHAPTER 4 - THE IMAGE EDITOR

ABOUT IMAGES
Images are pictures ... this is very obvious but what is not obvious is the various types that the Apple IIgs uses.

Most people are familiar with PIC images.made by commercial "paint programs". PIC images can be in either 320 or 640 mode. [320 x 200] or [640 x 200] pixels. 320 mode PIC images can use 16 different solid colors while 640 mode PIC images can use only 4. You will see 640 mode images that appear to have more than 4 colors but don't be fooled. There are only four possible solid colors. When you see a 640 mode picture that appears to have more than four colors it is using dithered colors which are two dissimilar 640 mode pixels next to each other. The combination will appear as a third color to the eye. These images can be said to be 320 mode in a 640 mode framework.

This can be confusing. It is not too important that understand the details ... ( but it is nice if you do!) The image editor handles these things automatically and provides you with 16 colors in both modes.

The Apple IIgs uses other images based on the above. This editor can create, Pixel Images, Icons and cursors.

A Pixel Image is a PIC Image that is less than 320 x 200 or 640 x 200 pixels in size ... kind of a mini-PIC.. Pixel images are always rectangular.

Icons are similar to pixel images except that they contain a mask. A mask is an image the same size as the main pixel image that signifies which pixels will show up and which ones will not. This allows you to create images that are not rectangular. They can be of any shape, and even have holes in them like a doughnut.

The last type of image is a Cursor. Cursors are similar to an Icon but are handled differently by the system. The ARROW is an example of a cursor image. Cursors have an attribute that other images do not have, this is a "Hot Spot". A Hot Spot is that pixel out of the image that represents the cursors actual X and Y position. The tip of the ARROW cursor is its hot spot.

The image editor makes it very easy to load one type of image and save it as another type. The main power of this editor, however, is in enabling the user to take a standard "Paint Program" type picture and capture a portion of it as either a pixel image, Icon or cursor.

EDITOR OPERATION
To use this editor you must put an image in the "capture window", by loading in any of the seven input types previously described using the menu bar selection File/Open. or by selecting FileINew320 or FilelNew640. If you are using a Filetype $C1 picture as an image source the editor will switch to the mode (640 or 320) that the picture was created in. You will have to use FileINew320 or FileINew640 to set the mode prior to loading the pixel image, icon or cursor types.

Once you have an image (even if its a blank screen for creating an image from scratch) you must select Edit/Capture and using the full window crosshair cursor click-drag-click a rectangle around the image you want to process. The image will slowly invert and an indicator bar will appear reporting the progress of the magnify operation taking place.

This magnify operation creates three windows containing the image just captured in a magnified form called "Image". The mask image (always completely black after capture) in a magnified form called a "Mask" and the captured image as an icon called an "Icon". The Image and Mask windows are editable with the "Pencil" cursor which is visible when the cursor position is in either window when it is the top-most or active window. The menu bar selection "Color" is now active and contains a color palette used to set the pencil color. You can now use the pencil to draw to the magnified image or mask.

Three functions help in drawing to the magnified images. Edit/Fill Image will change every pixel in the image window to the current color of the pencil. Edit/Fill Mask will set all the pixels in the mask window to black or white (on or off) using color #15 as white and any other color as black. Edit/Image to Mask will set all pixels that correspond to colored pixels in the image window to black (on) in the mask window and set all corresponding white (color #15) pixels to white (on).

If you need to reframe your image you can select Edit/Re-Capture which clears out the capture window and plots your current magnified image in the upper left region of the capture window. You then need to select Edit/Capture and capture your image again only this time at new rectangular coordinates which will in turn create the Image, Mask and Icon windows again. You can continue editing if needed.

If you are creating a Cursor you will need to set the "Hot Spot" with the menu selection Edit/Set Hot Spot. The hot spot is represented by a black rectangle initially around the upper left pixel of the magnified image. Simply select Edit/Set Hot Spot and click on the magnified pixel you want for the hot spot. The rectangle will move to surround the selected pixel.

When everything is just the way you want it select File/Save as.to preserve your handy-work. Be sure to set the radio buttons at the bottom of the save window for the type and style.

This outlines the major features and procedures implemented in using this editor, we will now discuss some of the finer points of image editing.

Special Explanations

  • All images, either 320 or 640 mode can be treated like 320 mode images. Most good looking 640 mode images are actually in dithered colors which is simply two pixels of different colors side by side that appear like one larger pixel in a color that is the mix of the two colors. This way you can get sixteen apparently different solid colors in 640 mode that only has a palette offour colors (read about minipalettes in the IIgs toolbox reference under Quickdraw II). If you are using dithering, and you probably will be, then you are actually handling a 320 mode image because one apparent pixel is composed of two smaller (640 mode) pixels.

  • You can capture a 320 mode image, save it as a pixel image, switch modes using FileINew640 and re-load it for editing in the new mode, the reverse is also true. Naturally the colors will be off but this is not important. A Pixel image, Icon or cursor responds to the current system palette your program is using, not necessarily the one that you are currently editing in. You are just producing a byte pattern that represents what color numbers to use and where they are to be used.

  • 640 mode images sometimes exhibit a color shift which depends on where the viewable image has its left edge (on an even or odd numbered position). This is due to the mysteries of Dithered colors and poses no problems to your finished image. The image in the Icon window is a true representation of the colors in your finished image, the colors in the Image window mayor may not be accurate in 640 mode depending on how the horizontal scroll bar is set.

  • Cursors have a unique mode sensitivity problem which deals with the hot spot. If a cursor is created in 320 mode and then used in 640 mode the cursor will appear the same in both modes. The difference will be in the actual position of the hot spot. To best illustrate this anomaly an example is needed:

  • Create a cursor in 320 mode that is a framed rectangle 5 x 5 pixels. Set the hot spot at 3,3 (Right in the middle of the framed rectangle). Use this cursor in 640 mode and the hot spot will seem to shift to the left of the rectangle. The hot spot numbers will still be 3,3 but the rectangle will no longer be 5 x 5! A 320 mode 5 x 5 rectangle becomes a 640 mode 5 x 10 rectangle to maintain the same appearance. To rectify this situation you should use separate cursors for 320 and 640 modes. You could also directly rewrite the hot spot numbers based on the current mode your program is in. If your cursors hot spot is at a horizontal position of 0 or 1 don't worry. The mode shift is half the distance from the original hot spot to the left edge of the cursor. (if your position is 0 or 1 the shift is so slight as to not be noticeable).

  • As if cursors did not cause enough problems there is yet another thing you have to look out for. Add one extra word (4 magnified pixels) to the right side of your cursor image and fill them with zeroes (black in the image and white in the mask). The way the Apple handles cursors necessitates this. I won't get into it here. Failure to add this word will cause you equipment to behave strangely. Check it out for yourself its actually quite interesting to see.

  • The last thing we want to tell you about cursors is that you need a black (color #0) as the background of the image window and white (color #15) to draw your image. The colors are reversed in the image window when creating cursors.

  • This editor is memory hungry and should be used with all the free memory you can summon up (at least 3 or 4 banks). The maximum size an image can be is directly linked to how much free memory is available. Images in excess of 75 pixels square should be avoided, (images that large plot slowly). Secondly you will run out of memory in the editor. You can go as large as memory will allow. We recommend not exceeding 75 by 75 which should be sufficiently large for most applications.

  • You can close all of the windows except the Icon window by clicking in the close box of the windows frame. This will make the windows disappear. You can make the image and mask windows re-appear by selecting EditlImage Edit or EditlMask Edit. The capture window does not have a selection to make it re-appear. You will have to re-Ioad an image or use FileINew320 or FileINew640 to make the capture window appear.

  • SAVE IMAGES
    Once you have created an image you will want to save it to disk so it can be incorporated into your program code.

    Select FILE-SAVE AS ... and a save dialog box will appear. (See Fig 4.36)

    Figure 4.36
    Figure 4.36 Save Dialog Box

    This box has buttons to select the drive, create a new folder, open or close a folder, cancel the operation and save the file. There is also a box for typing in a filename and 6 radio buttons across the bottom of the dialog box. These six buttons select the type of output you will be saving.

    Three buttons on the left side of the dialog box select the style of of image you can save (Pixel image, icon or cursor). The three buttons on the right side select the filetype as Resource, Source or Binary.

    Images do not need to be relocated in memory because they do not have absolute address references. This is why a binary form is provided instead of object code. Both source and binary saves are fairly straight forward and need no real explanation. Selecting Resource however will present some extra windows that control how resources are saved to disk.

    Resources are identified by types and I.D.'s. The type for CALL BOX images are $1003 for pixel images, $8001 for icons and $1004 for cursors. These types are set by the editor, you need to set the I.D. for your resource. You can either rewrite an existing resource by double-clicking on its I.D. number or double-clicking the ---->New entry to save your resource as the next available I.D. number. (See Fig 4.37)

    You can cancel the resource save operation by clicking the close box in the title bar of the resource I.D. window. You can also edit the resource I.D. (re-number or delete) by pressing and holding he OPTION key while double-clicking the desired I.D. (See Fig 4.38). When re-numbering resource I.D.'s be sure to use 8 hex digits (use leading zeroes to pad small numbers). Failure to do so will cause unpredictable results and could ruin the resource fork of the ProDOS file.

    Figure 4.37
    Figure 4.37 Save Resource ID. window

    If a resource fork does not exist for a given ProDOS file a dialog box will appear giving you the option of creating one.

    Figure 4.38
    Figure 4.38 Edit Resource ID. Dialog Box

    LOAD IMAGES
    Once you have created images and saved them to disk you may want to load them back into this editor for further editing.

    Select FILE-OPEN ... and a load dialog box will appear.

    Figure 4.39
    Figure 4.39 Load Dialog Box

    This box has buttons to select the drive, open or close a folder, cancel this operation and open the file. There are six radio buttons across the bottom of the dialog box. These six buttons select the type of input you will be loading.

    When loading images you must be very careful to have these buttons set properly for the type of input you will be loading. All filetypes will appear selectable in the scroll window and no special filtering is provided due to the fact that resources can be contained in any filetype. Loading the wrong type of file can result in a crash! You will just have to be careful.

    Selecting Resource will present some extra windows that control how resources are loaded into memory.

    Resources are assigned by types and I.D.'s. The type for CALL BOX images are $1003 for pixel images, $8001 for icons and $1004 for cursors. These types are set by the editor.you set just the I.D. for your resource. You can either rewrite an existing resource by double-clicking on its I.D. number or double-clicking the ---->New entry to save your resource as the next available I.D. number. (See Fig 40)

    Figure 4.40
    Figure 40 Load Resource ID. Window

    You can cancel the resource save operation by clicking the close box in the title bar of the resource I.D. window. You can also edit the resource I.D. (re-number or delete) by using the OPTION key while doubleclicking the desired I.D. (See Fig 38) When re-numbering resource I.D.'s be sure to use 8 hex digits in the I.D. number (use leading zeroes to pad small numbers). Failure to do so will cause unpredictable results and could ruin the resource fork of the ProDOS file.

    If a resource fork does not exist for a given ProDOS file a dialog box will appear giving you the option of creating one.


    <- Previous | Next ->