The On-Line CB245 User's Manual

Current for CB245 version 50g


CB245 allows you to calibrate, scale, sharpen, filter, and save images from your Cookbook 245 CCD camera. Although image processing may seem like a "serious" subject, it is best to approach with a sense of "play." The best learning happens when you're having fun.


What CB245 Can Do

CB245 performs the following operations: dark-frame subtraction and automatic matching, flat-fielding, linear scaling, gamma scaling, gammalog scaling, logarithmic scaling, boxcar, binomial, Gaussian, triangle, and power-law unsharp masking, histogram shaping, rank processing, noise filtering, and saving in standard FITS and TIFF image formats.

CB245 also automates image processing with the Cookbook CCD camera. It automatically applies a script of image processing commands to a list of image files. The greatest value for Cookbook imaging is the speed and ease it brings to optimizing a night's production of images. CB245 can process a list of 255 images.

CB245 accepts the unique .PC, .PA/B and .P1/2/3 Cookbook file formats as well as standard FITS files created by the Cookbook CCD camera image acquisition software, and saves images in standard 16-bit FITS files, and the 8-bit grayscale TIFF file format.


What CB245 Requires

CB245 is a complex DOS-based program that handles large amounts of image data in memory. It is designed to run on virtually any PC with VGA graphics. For the greatest satisfaction, however, you should use it with a fast machine configured with DOS, TSRs, and drivers in high memory. Ideally, there should be at least 600KB of conventional lower memory available for CB245.

The Check Memory (CM) command enables you to check how much memory is available for images. If there is too little memory to process the images you wish to process, configure your computer to make more memory available by loading DOS and as many TSRs as possible into high memory and then run the MEMMAKER program supplied with MS-DOS 6 to optimize the configuration. This will leave plenty of conventional memory for CB245, and it will almost certainly improve the performance of your computer when you run other software, too.

If you use an operating system other than MS-DOS, you may experience problems making and loading lists of files. The most popular alternatives, 4DOS and NDOS, create directory files that differ from those made by the standard DOS programs. CB245 run correctly if you reboot your computer using the standard COMMAND.COM command processor supplied with MS-DOS. You can also run CB245 in a DOS window under Windows 3.1 or Windows 95, and for batch jobs, you can allow it to run as a background process,

It is important to rememeber that the quality of the output CB245 depends critically on the quality of your raw images. (GIGO!) For deep-sky imaging, it's important to shoot adequate numbers of dark frames. Shooting three or four darks before shooting a group of images and another three or four darks afterward, then average the darks to create a master dark frame and subtract it from each of the raw images. If the illumination on the CCD is uniform and your sky is reasonably dark, flat-fielding may add complication without greatly improving your images. For the best possible images, however, you should shoot multiple flat bright and flat dark frames, and then average each and subtract them to produce a master flat-field frame each night you image.


CB245 Basics in a Jiffy

For Individual files: To process an image, load the image and then type two-letter commands for each processing step. Commands for loading, stretching, enhancing, merging, and saving files are built into CB245. You can also load a single image and process it with a script, a stored list of commands.

For multiple files: To process more than one file, follow these steps.


How to Process a Single Image in CB245

To load a single image, type the Load command (LO). After you enter the file path (drive:\directory\subdirectory) and the name of the file (filename.ext), CB245 will load the file into memory. You can then apply any of the image-processing functions built into CB245 to process the currently loaded image.


Getting the Single-Image Menu

You can toggle between the several menus by typing the XX command. Although every command on the menus are continuously available, the XX command allows you to see those of current interest. The default menu is the single-image menu.


Summary of Single-Image Commands

Each command acts on the image present in memory at the time you give the command. Each time CB245 executes a command, the image created by the command overwrites the image stored in the computer's memory.

As you invoke these commands, CB245 will prompt you for necessary parameters. These are the same parameters that you must specify when you create a script; by experimenting in single-image mode you can optimize a script quite rapidly.


Utility Commands

DI [Directory] allows you to set the default LoadPath and shows you the files found in that directory. By using a file specifier, you can selectively search for files of interest.

SD [Set Display] allows you to set your monitor for the optimum grayscale image display. Black/White sets the pixel values that display as pure black and pure white on CB245's display screen. The default values are 0 and 4095. If you are viewing lists of unprocessed images, you can set BW to display a dim or weak image. The gamma value compensates for the nonlinear display of your computer's monitor. Monitors for PCs and PC clones usually have a gamma value between 1.6 and 2.0. The aspect ratio is the pixel width divided by the height; CB245 sets the aspect ratio each time it loads an image.

GR [Grayscale] restores the screen to the standard gray scale. Use this command after you have used a palette and want to return the screen display to normal.

ED [Edit/Examine] displays the current image and the value of the "active pixel" under the cursor. The sample and line of the active pixel, as well as its pixel value (PV) are shown at the top of the screen. Examine also allows you to alter single pixels to improve the cosmetic appearance of the image. Use the arrow keys to move the highlighted active pixel. The [pgup] and [pgdn] keys change the value of the active pixel rapidly, and the [home] and [end] key change the value of the active pixel slowly.

QU [Quit] returns to DOS or Windows.


Single-Image File Commands

LO [Load] retrieves an image from disk. CB245 loads the following image file formats:

For the .PA/B and .P1/2/3 formats, specify the .PA or .P1 component; the .PB and .P2/3 sections are loaded automatically. Load also loads image lists with the .LST extension, scripts with the .SCR extension, and palettes with the .PAL extension.

SU [Subtract] removes bias and thermal noise from the current image in memory. This allows you to dark-correct images with CB245; dark-correction is an essential part of the process of calibrating your images properly. CB245 will not allow you to subtract an dark frame that does not have the same dimensions as the image.

DK [Dark Match] does an optimal job of matching your images and dark frames. You can, for example, use dark matching to remove a dark frame made with an integration of 300 seconds from a 60-second integration, or even a 1 second integration. However, to use dark matching, you must have taken both the image and the dark frame with Drift Subtract option in 245PLUS turned ON.

ME [Merge] allows you to combine two images in a very flexible way. Each image is multiplied by a value you specify and a constant is added to their sum. To subtract images, use a negative multiplier.

FF [Flat-Field] corrects for pixel-to-pixel variations in an image based on a uniformly illuminated flat-field frame. Flat-fielding is part of image calibration. CB245 will not allow you to flat-field an image with a flat-field frame that does not match the dimensions of the image.

SA [Save] stores an image on disk. The extension you use for the file name tells CB245 how to store the image. When you specify the FITS format, you are prompted for header information. To save an image as a FITS file, use .FTS or .FIT; to save an images as a TIFF file, use the .TIF extension. When you save images as TIF files, CB245 automatically corrects for the aspect ratio of the pixels on the chip. PIX images become 192x192 TIF files; .PC images become 160x120 TIF files, .PA/B images become 320x240 TIF files, and .P1/2/3 files become 378x284 TIF files. Save also saves the current image list when you enter a file name with the LST extension, and saves the current script when you enter a file name with the SCR extension.


Single-Image Scaling Commands

ST [Stretch] shows you the histogram of the image and prompts you to pick new black (low) and white (high) pixel values. The image is then rescaled, and you can decide if you want to keep the result.

LI [Linear Scaling] automatically find preselected low and high pixel values and performs a linear stretch on the image. You specify the low and high points as decimal fractions of the pixels in the image histogram, and CB245 finds these low and high pixel values and applies the stretch. For a linear stretch, you'll get good results when the low point is .01 and the high point is .999.

GA [Gamma Scaling] automatically determines the low and high points from the histogram and applies a power-law scaling between them. When gamma is 1.0, gamma scaling is the same as linear scaling. Gamma values lower than 1.0 darken images and values higher than 1.0 lighten images. Gammas between 1.6 and 2.5 generally produce nice results on images of bright deep-sky objects.

GL [Gammalog Scaling] mixes a gamma scaling and a log scaling to produce a very effective hybrid for CCD images. The default value of 0.45 generally produces excellent results. Lower gammalog values produce darker images; higher gammalog values produce lighter images. Of the scaling commands in CB245, this is by far the most versatile and useful.

LG [Log Scaling] mixes a logarithmic scaling and a linear scaling according to a mix factor between a low and high point in the image histogram. When mix is 0, the stretch is purely linear; when it is 1, the mix is purely log.

HS [Histogram Shaping] forces the histogram into a pre-defined shape. When the concentration factor is 0, the histogram is flat; as the value of this factor rises, the histogram concentrates in the center. For best results, experiment with values between 1.2 and 1.5. Values higher than 1.5 tend to make the image dull and gray. When skew is greater than 1, the image becomes lighter, and when skew is less than 1, it becomes darker.


Single-Image Filtering Commands

SH [Sharpen] applies a simple 3-by-3 convolution matrix to the image. The results tend to be noisy, but this function is very fast.

UM [Unsharp Masking] applies a "boxcar" unsharp mask to an image, enhancing the contrast of small detail by the contrast factor. The radius parameter controls the size of the mask.

BU [Binomial Unsharp Masking] applies a "haystack"-shaped unsharp mask to an image, enhancing the contrast of small detail by the contrast factor. The radius parameter controls the size of the mask. Excellent for cleaning up images dominated by star images.

GU [Gaussian Unsharp Masking] applies a Gaussian unsharp mask to an image, enhancing the contrast of small detail by the contrast factor. The radius controls the size of the core-region of this mask. Although Gaussian unsharp maksing is the all-around, all-purpose filter, note that it is especially useful for enhancing detail in planetary images.

TU [Triangular Unsharp Masking] applies a triangular unsharp mask to an image, enhancing the contrast of small detail by the contrast factor. The radius parameter controls the size of the mask. Does an especially good job with lunar images.

PU [Power-Law Unsharp Masking] applies a hard-centered unsharp mask to an image, enhancing the contrast of detail by the contrast factor. The radius controls the size of the core-region of this mask. A very useful filter for images with both nebulosity and stars because it cleans up the star images. Especially good with the "haloed" star images typical of refractors.

RA [Rank Process] is an adaptive routine that finds image structure regardless of the brightness of the region searched. It will pick out near-nucleus structure in images of a comet, or low-contrast detail in a planetary atmosphere. The rank order filter tends to emphasizes noise in the absence of real structure. A radius of 6 with a mix of 0.5 produce interesting results with a wide range of images.


Single-Image Special Commands

CA [Cache] enables you to save a temporary copy of an image on your hard disk. You can restore the image at any future time using the restore (RE) command. To cache more than one image, use the C1, C2, C3, ... , C9 commands. Restore images cached this way using the R1, R2, R3, ..., R9 commands.

RE [Restore] enables you to load a temporary copy of an image cached on your hard disk. To restore images saved using the C1, C2, C3, ... , C9 commands, use the R1, R2, R3, ..., R9 commands.

CR [Crop] copies a section from an image. You can enter the upper left and lower right pixel coordinates directly, or use ED to define them. In the ED mode, press the "[" key to show the upper left corner and press the "]" key to define the lower right corner. Exit ED and type CR. Accept the coordinates shown, and you will shortly see cropped the cropped image on the screen.

CF [Crop Full] Use this special case of Crop to isolate the frame-filling center from a standard 378-wide Cookbook camera image. It is a good idea to use this command only with images of this size. The cropped region is 318x198 pixels.

RS [Resample] changes the size of an image. The smallest image allowed is only 10x10 pixels, and the largest is limited by available memory, usually around 512x384. You can use resample make square pixels. The dimension for square pixels are: PIX, 192x192; .PC, 160x120: .PA/B, 320x240; and .P1/2/3, 378x284. To display a Cookbook 245 image full screen, resample it to 320 wide by 200 deep.

HI [Histogram} displays the histogram of the current image. The number of pixels is displayed on a logarithmic scale. Tick marks on the bottom axis show 1000s, 500s, and 100s in a full scale of 4095 PV.

SF [Set FITS] Use this to set the variables in the FITS header. Loading a new FITS file may overwrite values assinged with Set FITS.


Handling Multiple Images with CB245


Organize your Images

It is best to name images serially, starting with FILE001*.PA, FILE002*.PA, FILE003*.PA, and so forth, with an prefix such as M33 ahead of the serial number. The Cookbook image acquisition software 245PLUS makes this style of naming easy.

CB245 employs two path variables: LoadPath and SavePath. These variables make it easy to keep unprocessed images and processed images with the same names in separate directories. For example, if you have stored the raw images you took June 3, 1996 in a subdirectory called C:\960603\RAW, that is your LoadPath. You can also store averaged calibration frames and scripts in the LoadPath directory.

Create another directory for processed images; for example, make a subdirectory called C:\960603\DONE. Use this as your SavePath and put all finished images in it. The finished images can have the same names as the raw images, but because of their location, there will be no confusion between raw and processed images..


Make and Load a List

Lists are groups of files for CB245 to process. There are several ways to create a list. You can type it in CB245 using the Type List (TL) command, you can generate it from inside CB245 using the Make List (ML) command, or you can load a previously created list using the Load (LO) command. You can also use any text editor to type or edit a list of files.

CB245 loads the following image file formats:

CB245 expects the list to consist of an eight-character filename (or a short name padded with blanks if there are fewer than eight characters in the name), one blank or one dot, and the file extension. For the .PA/B and .P1/2/3 formats, you need only list the .PA or the .P1 component; the .PB and .P2/P3 sections are loaded automatically.

ML [Make List] Creates a list of files to process. You must supply a directory mask and a name for the list file. The Make List function then automatically creates the list file. To process a selection of images such as those showing M33, use a mask such as M33*.PA and an name like M33.LST for the list.

TL [Type List] This command allows you to type filenames that you would like processed. If a list is already loaded, you will be able to edit the names in it. Type each name without extra spaces, and put no spaces after file names. Enter a blank line to terminate the list. CB245 will prompt you to save the list; the default directory is contained in the variable LoadPath.

LO [Load] Retrieves from disk a list of files to view or process. If you've just made a list, CB245 presents the list you just made as the default. Once you have entered a list file name, it loads the list and displays the image file names. If you have not entered the LoadPath correctly, you will see a message saying that CB245 cannot find the file. Load List also tells you how many files are present in the list.

Using DOS You can generate list files using the DOS DIR command. For example, to create a list of all files having the file extension .PA and to name the output file FILES.LST, type:

This list will contain all the files in the C:\951225 directory with the extension .PA. You can edit the list in the DOS EDIT program or any non-formatting text editor.


3.3. Make and Load a Script

There are two ways to get a script into CB245. You can type the script directly using the Type Script command, load a Canned Script from a selection on disk, or retrieve a script that you have previously saved to disk.

LO [Load] If you have a script stored on your disk, recall it with the LO command. After you have loaded a script, you can edit it using the TS command. The canned scripts on the distribution disk give you a good starting point for writing your own scripts to process images. The canned scripts are described and listed in §6.2.

TS [Type Script] Type each line of the script as you wish it to appear. Use one space (and only one space) between command parameters, and do not include any spaces after the last item on the command line. Enter a blank line to end the script.

If a script is already present in memory, you can edit the script. You can go down the script changing it line by line, but once you have left a line, you cannot go backward except by entering the type Script command again. If you think you will use a script again, save it with an .LST extension using the Save (SA) command.


Process a List of Files

PL [Process List] Once you have created a list of files and a command script, you can process the images. CB245 can process each image in the list of files according to the commands in the script.

Before it begins processing, CB245 checks the script, and if it detects the SAVE command in your script, prompts you to confirm the current SavePath. After processing begins, you can interrupt it by pressing the [esc] key. CB245 will complete the current process and then ask if you wish to abort the run. If you do not, processing resumes where it was interrupted.

Aborting a run returns you to the main menu leaving your list and your script intact. The current image will be the last image you saw on the screen. You may modify the list and the script and then begin a new process. Once you have exited a processing run, you can return to the point you left only by changing the image list.

When you load a single image, CB245 treats it as a new list consisting of one file. This allows you to test and refine your scripts on sample images before starting to process a lengthy list. Even though it consists of just one file, this new list supersedes any previous list you may have loaded.


View a List of Files

VL [View List] displays the files in the current list. You can use this to delete images that you do not want in the list of images. After you have edited a list with the list viewer, you can save the edited list. You can move backward or forward in the list, and skip to the beginning, middle, or end of the list. By pressing the X key you can delete a name from the list. To exit the View List function, press the [esc] key.

You can use this utility to determine which are the best images from an evening's work. After you have eliminated trailed and otherwise damaged files, save the list and process only the best images.

When you view a list of images, the image on the screen when you exit becomes the new default for the LO command. You can thus use VL to browse a list and subsequently load the selected image.


5. Average a List of Files

AL [Average List] You can average of up to 15 images in a list. Use it to average dark frames and flat-field frames. By averaging your calibration frames you can obtain a better signal-to-noise ratio in your flat-field or dark-frame than you could from a single file.

As it operates, the Average List routine loads and displays each frame. Watch carefully as the files load to be sure that nothing pathological gets into your averaged file. Note that CB245 checks the first image in the list and will only average subsequent files having the same pixel dimensions; that is, you can only average 252x242 images with other 252x242 images.

When all of the images have been averaged, the result remains in memory. After checking that this image is satisfactory, save it for later used in calibrating your images.

If you need to average more than 15 images, use Multi245. It can average as many as 255 images, and can also perform automated stack-and-track compositing of up to 255 images.


Creating Scripts for CB245

Scripts consist of commands. Each command occupies one line. Each line consists of a four-character command that may be followed by several parameters. Parameters are separated by one and only one blank space. Parameters may be strings or numbers, depending on what the command requires.

Every script starts with the LOAD command; this tells CB245 to load the next file into memory for processing. A script may have up to 24 commands. You can test a script on a single image by loading the image and using the Process List (PL) command. CB245 treats a newly loaded image as a list consisting of one image. As a result, you can develop a script and test it repeatedly with Process List since the single image is treated as a list containing one file.

Please remember that image processing does not necessarily improve an image. Parameter values must be matched carefully to the type of image. The "canned" scripts illustrate this: process a planetary image using a deep-sky script, and vice-versa. When you have developed a script that does what you want with your images, be sure to save it!


CB245 Script Commands

The following commands can be used in CB245 scripts.

Script File Commands

Script Scaling Commands

Script Filtering Commands

Script Special Commands

Script Display Control Commands

Script Initialization Commands

Here are some hints on using script commands and parameters to build effective scripts. Remember that one space and one space only must separate the commands and parameters.


Script File Commands

LOAD filename.ext The LOAD command tells CB245 to load a file. If no filename is given, CB245 loads the next file from the current list. When used in this way, LOAD should be the first command in a script. If a file name is specified, CB245 will load it. It can be an image, a palette, or another script. Files are always loaded using the current LoadPath. An image loaded in mid-script overwrites the current image.

SUBT filename.ext To perform a dark-frame or thermal subtraction, give the path and name of the appropriate support frame. If the file is absent or misnamed, it reports that it could not find the file. You have the option to exit at this point and find the correct path. Files are always loaded for subtraction using the current LoadPath.

DARK filename.ext To perform dark-frame matching, give the path and name of the appropriate support frame. Files are always loaded for dark matching using the current LoadPath. The first time CB245 encounters a dark frame, it will perform a calibration routine and create a special calibration file. Subsequent dark-matching occurs very quickly. The scaling coefficient is shown on the screen. Use dark match only for images and dark frames taken with the Drift Subtract option ON.

MERG filename.ext x-current x-disk constant Merge is a versatile command that combines the current image in memory with another image loaded from disk. Each image is multiplied by a value that you specify. Multiplicative values may be positive, negative, or zero. The additive constant may also be positive, negative, or zero. Thus you can add, subtract, multiply, and divide single images or combinations of images using this command. Files are always loaded for merging using the current LoadPath. To subtract a scaleable thermal frame from a set of images, use a command in the form: MERG SCATHERM.FTS 1 -0.25 0. In this example, 0.25 is the scaling coefficient.

FLAT filename.ext To perform a flat-field correction, give the path and name of the flat file. As soon as start processing, CB245 will ask for the path of the flat file, and immediately load and display it. If the file is absent or misnamed, the program reports that it could not find the file and turns off flat-fielding operation. You have the option to exit at this point and find the correct path to the flat-field file. Files are always loaded for flat-fielding using the current LoadPath.

SAVE filetype Writes the processed file to disk in the format specified by filetype. Allowed image filetypes are Cookbook, FTS, FIT, and TIF. If you supply an unrecognized filetype, CB245 will tell you that it cannot save the image using the extension you have specified. In batch-process mode, FITS images are written using the header information currently in memory. To set the header variables, use the Set FITS (SF) command. The variables you set will be written into the header of each FITS file saved until they are overwritten by values from another FITS header. TIFF images are written to 8-bit aspect-ratio-corrected files having 192x192, 160x120, 320x240, or 378x284 pixels. You cannot reload TIFF files into CB245. Use the TIF format to export your Cookbook images to software such as Word for Windows, PhotoStyler, Quark Xpress, PhotoShop, or Pagemaker.


Script Scaling Commands

STRE The stretch command stretches pixel values linearly between a specified low value and a specified high value. The user must set these values directly.

LINS low high Linear scaling stretches the pixel values of the original image between low and high values that you select. The values of low and high are specified as the decimal fraction of pixels below and above their values. The program performs a histogram analysis to determine the pixel values of the endpoints. CB245 thus determines the actual stretch values. If you set low to .01, CB245 analyses the histogram to find a pixel value that is greater than 1% of the pixels in the image. Pixels below this value will have a pixel value of zero, i.e., they will appear black. If you set high to .999, then CB245 determines the pixel value that is greater than 99.9% of the pixels in the image. The remaining 0.1% of pixels will be saturated pure white. All pixels between the .01 and .999 levels will be rendered as shades of gray. If you set low to 0 and high to 1, the gray scale will stretch between the lowest and highest pixel values in the image. Although this sounds great, it usually allows a few oddball pixels to control the scaling of the entire image. For linear scaling, low values between .001 and .1 work well, with .01 generally the best. For high, values between .99 and .9999 work well. Values lower than .99 cause the image highlights to become saturated. A good choice is LINS .01 .999.

GAMS low high gamma Gamma scaling employs the same scheme for specifying low and high pixel values as LINS, but the values between are stretched nonlinearly by raising the gray scale to the power gamma. When gamma equals 1.0, gamma scaling is linear. Values of gamma lower than 1 increase contrast in the light tones in the images. This is useful for images of the planets, moon, and sun. For planetary images, gamma should be between .4 and .9, depending on how much contrast you wish. Values of gamma higher than 1 increase contrast in the dark tones of the image. This means that the dim parts of deep-sky objects are enhanced without washing out the bright parts. Values of gamma between 1.5 and 3 produce the best results. A good standard to use for deep-sky images is GAMS .01 .999 2. Low should be around .01 for deep-sky objects and high should be .9999 or greater for planets to prevent saturating too many pixels at the extremes of the gray scale.

GLGS low high gammalog Gammalog scaling also employs the low and high pixel-value scheme, but the gammalog function is a hybrid with properties unlike either gamma-scaling or log scaling. The best results usually result from a low value of 0.01, a high value of 0.9999, and a gammalog value of 0.45, that is, GLGS .01 .9999 .45. Gammalog scaling works well for deep-sky images, producing an image that resembles conventional astrophotography with high-contrast print papers, while still retaining the highlight regions of the image.

LOGS low high mix Logarithmic scaling is a very aggressive way to extract faint deep-sky objects from a sky background. But because the log function is too powerful for most images, the LOGS command allows you to temper the log function by mixing it with a linear function, giving you a versatile tool for scaling deep-sky images. Values of mix usually range between .1 and .6, depending on the image. "Log" scaling employs the same scheme for specifying low and high pixel values as LINS and GAMS, but the values between are stretched nonlinearly by taking the logarithm of gray scale and mixing it with a linear stretch according to the parameter mix. For the bulk of deep-sky images, the script command LOGS .01 .9999 .2 works well. It preserves highlights while showing dim objects. For faint deep-sky objects, try LOGS .03 .999 .4. This skims the bottom off sky noise while vigorously promoting faint nebular structure.

HEQU Performs classical histogram equalization. This is exactly the same as using the command HISH 0 1. It can produce hideous results or great results depending on the type of subject. If an image is dominated by light or dark pixels, HISH 0 1 generally makes a mess of it. However, on images of bright regions of the moon, it extracts a wide range of tonal values very effectively. See HISH. HEQU takes no arguments.

HISH concentration skew Classical histogram equalization is a scaling method that seeks to create an equal number of pixels for each pixel value; the command HISH 0 1 produces classical histogram equalization. Histogram shaping forces the histogram into a predetermined shape defined by the concentration and skew parameters. This is very flexible and powerful function. Using a value for concentration other than zero causes an increasing concentration of pixel values toward a central value. (In other words, it produces a bulge in the histogram.) The bigger the concentration, the bigger the bulge. The histogram of an image made using HISH 1 1 has approximately 1/5 as many pixels with a values of 0 and 4095 as it has pixel values of 2048. HISH 1.25 1 produces 1/20 as many; and HISH 1.5 1 roughly 1/200 as many 0- and 4095-value pixels. Values of concentration between 1.2 and 1.4 generally look best; values higher than 1.5 tend to be flat and gray. The skew parameter forces the concentration of pixel values to move higher or lower. If skew is 0.5, the peak concentration occurs at 1024; if skew is 0.333, the peak is 512, making the background sky dark. When skew is 1, the peak is at 2048, when skew is 2, the peak moves to 2,900. For deep-sky objects, HISH 1.4 .35 does very well.


Script Filtering Commands

SHAR The sharpen command works well with images such as room interiors, portraits, and astronomical images with subpixel focusing. Its primary advantage is that it is fast. SHAR takes no arguments.

USMA radius contrast Unsharp masking enhances medium-scale image structure. The minimum radius is 1 and the maximum allowed is 16. Radii of 2 or 3 pixels work well for planetary and lunar images. Contrast factors of 2 or 3 are generally neither too harsh nor too weak for planetary enhancement, but with exceptionally soft images, you may need to push contrast as high as 8. For images that look crisp to begin with, especially images taken at low focal ratios, the delicate touch of contrast of 1.2 to 1.5 helps the eye see detail. Unsharp-masking twice enhances fine-scale detail more effectively than single-pass masking. You'll usually get the best results when the second masking is less powerful than first; it should have the same or smaller radius and a lower contrast. The command USMA 3 6 followed by USMA 2 2 does a nice job on soft planetary images.

BUMA radius contrast Filtering with the "haystack"-shaped mask gives results similar to a Gaussian mask (see below), but the "binomial" routine is computationally faster. The haystack-shaped BUMA mask closely matches the profile of a typical stellar images, and thus it should produce better results than the "boxcar" filter because it more effectively prevents the leakage of high-frequency noise into the masked image. The result is not always subjectively more satisfactory, however, perhaps because the eye perceives a little high-frequency noise as sharpness. Because of its soft edges, the radii you use for BUMA should be about three times those in USMA. A good planetary mask might have a specification like BUMA 6 6, and you might want to follow this with a USMA 2 2 mask for added snap.

GUMA radius contrast Of the spatial filters, none beats the Gaussian mask, at least in theory. Not only does the Gaussian profile mimic the natural process of image blurring, but the Gaussian mask entirely blocks the high spatial frequencies that leak through many filters. The outstanding characteristic of the Gaussian profile is that it has no "edge" and therefore minimizes "ringing" artifacts that sometimes mar images processed with other filter profiles. Radii as large as 6 or 8 pixels may enhance the contrast of detail in deep-sky images of bright nebulae. A command to bring out structure in a typical deep-sky image would be GUMA 20 1.5. High values of contrast lead to an artificial appearance. Gaussian filtering works extremely well for soft planetary images that require high contrast values, especially Mars and Jupiter. A good filter to use is GUMA 1.5 6. An excellent and very powerful two-filter pair is GUMA 2 4 followed by GUMA 1.2 3.

TUMA radius contrast The triangular filter profile leaks high spatial frequencies like crazy, but this is subjectively attractive on images that have a high signal-to-noise ratio; this is typical of lunar images. For this purpose, the contrast should be fairly low, just 2 or 3. TUMA also produces crisp-looking results with globular clusters and other objects with intrinsically high contrast.

PUMA radius contrast Power-law unsharp masking employs a hard-centered mask that mimics star images with spherical aberration or chromatic blurring. PUMA does a great job on deep-sky images containing both stars and nebulosity. This filter is often subjectively better than USMA, GUMA, or BUMA, because the image produced appears crisp and sharp. PUMA does an excellent job on Saturn, too.

RANK radius mix This filter enhances fine structure in images. The radius defines a region within which CB245 determines the rank order of the central pixel value and scales this rank order to the full range of data. If the radius is 10, then in a box 21 pixels square, so the pixel must lie somewhere between the 0th and 440th in rank order. The value from the 0-to-440 range is scaled to a 0-to-4095 range. The mix parameter allows you to average this rank order with the pixel value in the original image. A mix of 0.4 means that you get a 40/60 mix of rank order pixel value and original pixel value. RANK finds structure and features regardless of the brightness of the region searched. It will pick out near-nucleus structure in an image of a comet, or low-contrast detail in a planetary atmosphere.


Script Special Commands

HIST Displays a histogram of the current image. If you want to see the histogram, put a WAIT command in the script following HIST. HIST takes no arguments.

CROP uls ull lrs lrl Crops an image using the upper left and lower right pixel coordinates of the image. The upper left coordinates sample and line pixel coordinates are (uls, ull) and the lower right coordinates are (lrs, lrl).

RESA newsamples newlines Resamples an image to new pixel dimensions. This function is applied automatically to any standard-size Cookbook image saved in the TIF format. To resize a Cookbook image to exactly fill the VGA screen, resample it to 320x200 pixels using RESA 320 200.


Script Display Control Commands

CLSC This command clears the screen. CLSC takes no parameters.

DISP This command displays the current image on the screen. DISP takes no parameters.

GRAY This command restores the standard 256-step gray palette. GRAY takes no parameters.

LOAD palette.PAL The LOAD command can load a color palette. The palette must be in the current LoadPath. Note that the LoadPath can be changed by using the LOPA command immediately before the palette is loaded, and reset in the following command.

WAIT seconds Immediately after processing one image, CB245 clears the screen and loads the next, leaving you no time to study the newly processed image. To insert a pause, use the WAIT command. The minimum wait time is 1 second and the maximum wait time is 60 seconds.


Script Initialization Commands

CB245 initializes itself on loading from a script named CB245.INI. If this file is present in the directory in which CB245.EXE resides, this script will load, execute, and erase itself automatically. It is convenient to set the LoadPath, SavePath, monitor gamma, and FITS header defaults using a self-loading initialization file. Use the TS command to create the script and the SA command to save it with the name CB245.INI.

LOPA d:\path This command sets the LoadPath to D:\PATH.

SAPA d:\path This command sets the SavePath to D:\PATH..

LOAD filename.ext This command loads a file such as a palette, script, or list. If you want to use SEPIA.PAL all the time, or the same list of files over and over, or a script that is really nifty, load it when you initialize.

ASPE aspect_ratio This command sets the current aspect ratio. Loading an image overrides the old aspect ratio. If you have FITS images with unusual aspect ratios, set it using this command immediately after you load the image. Example: ASPE 0.667.

GAMM monitor_gamma This command sets the gamma correction for your monitor. Most monitors have a gamma between 1.6 and 2.2. CB245 uses 1.9 as its default value, so if your monitor is different, initialize it here.

OBJE object_field Sets the object string in the FITS header.

OBSE observer_field Sets the observer string in the FITS header.

TELE telescope_field Sets the telescope string in the FITS header.

INST instrument_field Sets the instrument string in the FITS header.

COMM comment_field Sets the comment string in the FITS header.


Examples of CB245 Scripts

Here are some examples of scripts that work well. Some features to note are: 1) all scripts begin with LOAD; 2) scripts shown here usually that SAVE be done in the TIF format so that your images are ready to importing into other desktop-publishing or other image-processing software.

SDEEPSKY.SCR This "standard" deep-sky script works nicely on bright, fully exposed images that have good signal-to-noise ratio. The very gentle Power Law unsharp mask adds just a touch of crispness to the image. Noise reduction knocks out any hot pixels remaining, and often cleans up some of the 1% of pixels made black by the gamma scaling.


UDEEPSKY.SCR This "universal" deep-sky script does an nice job with virtually any deep-sky image you give it. It works well with both well-exposed images of bright objects and short exposures on very faint objects. For optimum results with well-exposed images, you may prefer the standard deep-sky script because it retains detail in the bright portions of nebulae, which the universal script does not. For extremely faint objects, the "maximum" deep-sky script may produce more contrast. As an all-around image processing tool, you can't beat the histogram shaping.


MDEEPSKY.SRC This "maximum" deep-sky routine is designed to bring out all the detail that any deep-sky image has to show while preserving detail in the brightest areas. By using a gammalog scaling, the sky stays dark but nebulosity is very strongly extracted. Note that for gammalog and log scaling, the number of white pixels must be kept small. Lower values generally do not work well.


PLANETAR.SCR This planetary script produces good results with focal ratios around f/20 and excellent seeing. Here the power-law unsharp mask restores lost detail to your planetary or lunar image. If the image remains fuzzy, edit the script to add a second pass. PUMA 3 3 followed by PUMA 2 3 is not excessive processing for a high-quality data.


SPLANETA.SCR This "soft" planetary script is close to optimal for Nyquist sampled images taken around f/30 or images taken in less-than-excellent seeing. This routine is quite powerful. Ingoing images may look terrible, but the processed images often show features that were all but invisible before processing. The low value of gamma enhances the contrast of light features.


LUNAR.SCR Lunar images have a lot of contrast to start with, so the processing routines that work best need to enhance features rather than restore contrast. This script works best with images shot around f/20. Linear scaling makes every image in a set match nicely in brightness and contrast; images processed with this script composite very well.


COMET.SCR Cometary images have a wide dynamic range with subtle, low-contrast details hidden in the coma and inner tail. The rank-order process extracts this hidden and low-contrast structures. Rank-order processing often produces ugly images while revealing structure that would otherwise be lost. Try this script on tough subjects like M31, where interesting low-contrast detail is buried in a wide range of brightness.


SLIDESHO.SCR This simple slide show script loads an image, leaves it on the screen three seconds, clears the screen, and then loads the next. The effect is like a slide show. If you omit the CLRS command, then you get an effect like a wipe, with each image blending into the one before it. If you omit both WAIT and CLRS, one image will follow the next in rapid succession.


Learning to Use CB245

CB245 is a complex and versatile program that is easiest to learn if you begin by using the current commands and process images step-by-step. You would, for example, load an image, then scale it, unsharp mask, noise-filter, and save it.

Do not neglect the element of "play" possible with image processing. Try lots of things and don't worry if the results are ugly. Playing with images is the best way to learn about image processing.

The second stage in learning CB245 is to load canned scripts and process images with them. You can next write and refine your own image-processing scripts. Your scripts will soon do a more consistent job of image processing than you could by yourself.

Finally, you will begin to process lists. If you take your own images, you will soon appreciate how nice it is to create a list and a script, then leave the computer to process the images while you take a break. This allows you to let the machine apply the standard routines that work well and leave you free to focus your energies on the creative side of image processing.


Files Included when you order CB245

These files are included on the CB245 distribution diskette. They enable you to see representative amateur images and experiment with the program's capabilities.

These images were taken at the 1993 Midwest AstroFest meeting with a Cookbook 245 camera using 20-inch f/4.5 reflector built by Dave Otto and Dan Joyce. The exposures were all 60 seconds or under because of a periodic error in the telescope's clock drive. Note the tremendous detail obtained regardless!

These images are track-and-stack images made from 20 one-minute exposures taken with a 6-inch f/5 Newtonian reflector from my observing site in Lyons, Oregon.

The first two images were taken by Steve Lee from his observatory "Rainbow" near Coonabarabran, NSW, Australia, with an 8-inch f/4.5 Newtonian reflector and integration times of several minutes.

In working with these images, you may particularly wish to experiment on the image of M31 using large unsharp masks and rank-order processing. The region near the nucleus contains a wealth of low-contrast dark nebulosity that forms a spiral pattern coming from the nucleus. Photographs seldom show this structure because of the large brightness gradient and that simple fact that the nuclear regions are often overexposed.

Large unsharp masks seem to work quite well in bringing out the nebular structure. If the blooming trails bother you, remove them using the pixel-editing capability in the Edit function. The [pgup], [pgdn], [home], and [end] keys can "retouch" bloomed pixels. Because this process is rather tedious, you will be tempted to remain fairly "honest" when you alter images.

In addition to the image files, the following palettes are supplied:

The following "canned scripts" are also included:

As you work with them, remember that there is no "best way" to process images. You must experiment and learn what each image has to offer and how to best reveal it. When you find processes and parameters and combinations of processes that work well, preserve them as scripts so that in the future you can process new images with even greater ease.


Return to the begining of this document.