home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
c't freeware shareware 1999 February
/
CT_SW9902.ISO
/
mac
/
software
/
wissen
/
daten
/
tnimg227.exe
/
TNIMAGE.DOC
< prev
next >
Wrap
Text File
|
1997-03-19
|
321KB
|
6,777 lines
======================================================================
0.0.0
TNIMAGE.DOC
Description of TN-Image Image Analysis Software
Latest version: 2.19
Latest revision: 03/15/1996
Ordering: T.J. Nelson
Box 275
11140 Rockville Pike
Rockville, MD 20852
USA
e-mail: tjnelson@las1.ninds.nih.gov
or
Compuserve: 71461,1473
or
71461.1473@compuserve.com
ftp sites:
las2.ninds.nih.gov: /pub/tnimage
las1.ninds.nih.gov: /pub/tnimage
A collection of sample images, mostly in TIF format,
is also available at these sites. These are also the
ftp sites for NPLOT, the scientific graphics plotting
program, and TNSHELL, the powerful DOS shell.
The program is also available at SimTel mirror sites.
BBS sites: Compuserve, IBMAPP, library 10
America On Line
======================================================================
1.0.0 Introduction
Welcome to TN-Image!
TN-Image is an advanced image analysis program oriented toward
scientific and technical image analysis and editing. This manual
describes the various funtions of TN-Image. Not all the features
of TN-Image are available on the shareware version; however, it
is still a powerful, functional image editing program.
1.0.1 About this document
This is the text-only manual for the DOS version of TN-Image and
is no longer current. Consult the PostScript version of the manual
(tnimage.ps) for more up-to-date information.
1.1.0 Contents
Introduction..................................................1.0.0
Contents...................................................1.1.0
Summary.......................................................2.0.0
Usage License.................................................3.0.0
Differences between shareware and registered versions......3.1.0
Submitting bug reports.....................................3.2.0
Technical support..........................................3.3.0
Upgrade policy................................................4.0.0
System Requirements...........................................5.0.0
Overview......................................................6.0.0
File types supported.......................................6.1.0
Pixel intensities..........................................6.2.0
Menu bars..................................................6.3.0
Tutorial files.............................................6.4.0
Operation.....................................................7.0.0
Command line options ......................................7.1.0
Unix command line options................................7.1.1
Video cards supported......................................7.2.0
Screen modes supported.....................................7.3.0
Basic operation............................................7.4.0
Operating under low-memory conditions......................7.5.0
Commonly asked questions...................................7.6.0
Batch-mode processing......................................7.7.0
Editing text files.........................................7.8.0
Menu Options..................................................8.0.0
File Menu..................................................8.1.0
Load Image.............................................8.1.1
Reading CT, X-ray and NMR images and raw bytes......8.1.1.1
Reading Imaging Systems files.......................8.1.1.2
Reading Images from Macintosh systems...............8.1.1.3
Reading raw ASCII images............................8.1.1.4
Save Image.............................................8.1.2
Printing Images........................................8.1.3
B/W printing........................................8.1.3.1
Color printing......................................8.1.3.2
Printing under Unix.................................8.1.3.3
Printing to a file or different printer.............8.1.3.4
Change Title...........................................8.1.4
Save scan data.........................................8.1.5
Create/Resize Image....................................8.1.6
Switch to..............................................8.1.7
Create File Format.....................................8.1.8
Save FFT...............................................8.1.9
Erase FFT..............................................8.1.10
Unload image...........................................8.1.11
DOS Command............................................8.1.12
Quit...................................................8.1.13
Load FFT...............................................8.1.14
Image menu................................................8.2.0
Delete region..........................................8.2.1
Crop...................................................8.2.2
Erase background.......................................8.2.3
Move...................................................8.2.4
Copy...................................................8.2.5
Change size............................................8.2.6
Rotate image...........................................8.2.7
Flip horizontally......................................8.2.8
Flip vertically........................................8.2.9
Back up................................................8.2.10
Restore................................................8.2.11
Process menu..............................................8.3.0
Filter.................................................8.3.1
High pass...........................................8.3.1.1
Low pass............................................8.3.1.2
Background subtract.................................8.3.1.3
Background flatten (de-trending)....................8.3.1.4
Noise reduction (median) filter.....................8.3.1.5
Laplace edge enhancement............................8.3.1.6
Sobel edge enhancement..............................8.3.1.7
Edge detection......................................8.3.1.8
Adjustable parameters...............................8.3.1.9
Warp...................................................8.3.2
Measure................................................8.3.3
Distance............................................8.3.3.1
Angle...............................................8.3.3.2
Calibration............................................8.3.4
Spot Densitometry......................................8.3.5
Area Measurements...................................8.3.5.1
Strip Densitometry.....................................8.3.6
Plotting densitometry results and other data........8.3.7
Peak areas..........................................8.3.8
Trace curve............................................8.3.9
Mathematical pixel operations..........................8.3.10
FFT (2D Fourier Transform).............................8.3.11
Convolution.........................................8.3.11.1
Deconvolution and image reconstruction..............8.3.11.2
Digital filtering using FFT.........................8.3.11.3
Macros.................................................8.3.12
Macro command summary...............................8.3.12.1
Macro programming guide.............................8.3.12.2
Color Menu................................................8.4.0
Set color..............................................8.4.1
Color intensity/brightness.............................8.4.2
Changing brightness using the palette bar...........8.4.2.1
Changing brightness using the menus.................8.4.2.2
Contrast...............................................8.4.3
Changing contrast using the palette bar.............8.4.3.1
Changing contrast using the menus...................8.4.3.2
Palette (colormap).....................................8.4.4
Select palette......................................8.4.4.1
Grayscale intensity mapping.........................8.4.4.2
Read palette from disk..............................8.4.4.3
Save palette to disk................................8.4.4.4
Create palette......................................8.4.4.5
Invert palette......................................8.4.4.6
Rotate palette......................................8.4.4.7
Restore original palette............................8.4.4.8
Remap colors...........................................8.4.5
Invert colors..........................................8.4.6
Change color depth.....................................8.4.7
Color->gray scale......................................8.4.8
Gray scale->color......................................8.4.9
Histogram..............................................8.4.10
Change pixel value.....................................8.4.11
Draw menu.................................................8.5.0
Set color..............................................8.5.1
Line...................................................8.5.2
Circle.................................................8.5.3
Box....................................................8.5.4
Arrow..................................................8.5.5
Curve..................................................8.5.6
Bezier curve.........................................8.5.6.1
B-spline curve.......................................8.5.6.2
Least-squares line...................................8.5.6.3
Polygon..............................................8.5.6.4
Text direction.........................................8.5.7
Font...................................................8.5.8
Sketch.................................................8.5.9
Fill region............................................8.5.10
Gradient fill .......................................8.5.10.1
Paint region...........................................8.5.11
Diffuse spray..........................................8.5.12
Fine spray.............................................8.5.13
Add border.............................................8.5.14
About menu................................................8.6.0
About the program......................................8.6.1
About the file.........................................8.6.2
About the image........................................8.6.3
How to register........................................8.6.4
Configure menu............................................8.7.0
Show menu bar..........................................8.7.1
Show menu bar 2........................................8.7.2
Show palette...........................................8.7.3
Redraw menu bar........................................8.7.4
Redraw palette.........................................8.7.5
Show O.D. table........................................8.7.6
Pixel interact mode....................................8.7.7
Configure............................................. 8.7.8
Automatic undo......................................8.7.8.1
Spray factor........................................8.7.8.2
Cursor movement rate................................8.7.8.3
Color settings......................................8.7.8.4
Significant digits..................................8.7.8.5
Crawl delay.........................................8.7.8.6
Crawl density.......................................8.7.8.7
Active color planes.................................8.7.8.8
Help menu.................................................8.8.0
Miscellaneous features....................................8.9.0
Frame rate test........................................8.9.1
Windows and OS/2 compatibility...............................9.0.0
Changing Computers..........................................10.0.0
Problems....................................................11.0.0
Limitations and known bugs..................................12.0.0
Error messages..............................................13.0.0
Trademark disclaimers.......................................14.0.0
2.0.0 Summary
|---------------------------------------------------------------------|
| |
| TN-Image allows you to view, edit,and print PCX, IMG, TIF (both |
| Macintosh and PC), JPEG, BMP, GIF, and TGA images, of any depth |
| between 1 and 32 bits per pixel, color or monochrome, as well as raw|
| binary images and user-definable image formats. You can edit, |
| cut/paste, add text, adjust color intensity or contrast, superimpose|
| multiple images, and create drawings using lines, circles, splines |
| and Bezier curves. It handles 8 bit/pixel (indexed-color), as well |
| as 15,16, 24 and 32-bit per pixel screen modes. In the pseudo-color |
| modes, you can change the color palette to one of 10,000 pre-defined|
| palettes or graphically create a new one. TN-Image is completely |
| menu-driven with an extremely user-friendly graphical user |
| interface. Dialog boxes and graphs can all be clicked-and-dragged to|
| one side so as not to obscure the image. Image size is limited only |
| by available memory or disk space (whichever is greater). |
| |
| TN-Image is particularly useful for scientific image analysis, |
| with densitometry, background subtraction, molecular weight calib- |
| ration, and automatic detection of peaks, bands and spots in your |
| image for quantitative measurement of optical density. Images deeper|
| than 8 bits/pixel, such as medical grayscale images, can be viewed |
| with a sliding scale to enhance any particular intensity region. |
| Images can be rotated, resized, warped, flipped, color-remapped, or |
| filtered (with sharpening, blurring, 3 types of edge enhancement, |
| freeze-fracture effect (shadow sharpening), background subtract,or |
| noise filter). Quantitative data, peak area tables, or color histo- |
| grams can be exported to an ASCII file with a single mouse click. |
| |
| Areas or parts of images can be filled with a solid color or a color|
| gradient, copied to another region, superimposed, subtracted, XOR'd,|
| added, averaged or erased. All operations function seamlessly across|
| multiple images regardless of their color depth. Images can be up- |
| or down-converted into a different color depth. |
| |
| It is particularly useful to biochemists and molecular biologists |
| who wish to analyze SDS gels, blots, and DNA gels. The blot can |
| simply be scanned in any scanner, then imported as an image file |
| into TN-Image and labeled, analyzed, quantitated, and printed on a |
| laser printer. Printed blot images and quantitative results have |
| already appeared in several scientific papers. The print quality |
| is optimized for high resolution, and gives extremely high quality |
| output on a laser or inkjet printer up to 2400 dpi. |
| |
| Images can be Fourier-transformed and the real or imaginary compon- |
| ents can be viewed, edited and modified. Pairs of images can also be|
| convoluted and deconvoluted. Power spectra can also be viewed. |
| |
| TN-Image can use up to 2GB of extended and virtual memory. Up to 512|
| images can be viewed and edited simultaneously. The program requires|
| an 80386 with a minimum of 4MB of RAM, DOS 3.2 or above or a |
| supported version of Unix, and a Super VGA monitor. It handles all |
| VESA screen modes, including 1600x1200 |
| resolution, in 256, 32768, 65536, and 16 million (true color) modes.|
| A mouse is required. Laser or inkjet printer is required for |
| printing. TN-Image can also run in a DOS box under Windows or OS/2 |
| if desired. |
| |
|---------------------------------------------------------------------|
3.0.0 Usage license
*****************************NOTICE********************************
The author makes no claims or warranties concerning the accuracy
of the information presented herein, including, but not limited to,
any implied warranties of fitness or suitability for any purpose
and is not responsible for any loss, damage, inaccurate medical
diagnosis, or personal injury occurring out of or in connection with
the use of this product. In no event shall the author, or any other
party who may have redistributed the product as permitted above, be
liable for any damages, including any general, special, incidental, or
consequential damages arising out of the use or inability to use this
product, including but not limited to loss of data or data being
rendered inaccurate or losses sustained by you or third parties or
any failure of the product to operate with any other programs, even
if such holder or other party has been advised of the possibility of
such damages.
***********************************************************************
The following applies only to the DOS version of TN-Image.
The program TN-Image is not free software or public domain software,
but shareware. However, you may use the shareware version without
charge for a limited time (up to one month) to evaluate its suitability
for your needs. AFTER THAT TIME, YOU ARE REQUIRED TO REGISTER YOUR
COPY OR DISCONTINUE USING IT.
To register, send your $25 registration fee to the above address. A copy
of the registered version will be mailed to you, or if you prefer, sent
electronically. Please indicate where you obtained your copy (e.g., by
ftp'ing, from Compuserve, etc.). This information will be used to help
ensure that future upgrades can be posted to that location. Requests for
modifications to the program (such as supporting new features, new types
of SVGA cards, etc), and assistance, are welcome from all registered
users. An order form is included in the file TNORDER.FRM.
If for some reason you are unable to send your registration to a
P.O. box, feel free to contact me for a street address.
The shareware version of TN-Image, including this manual, may be
freely redistributed, copied, and uploaded to computer networks or
bulletin boards without restriction, provided that the following
conditions are met:
(1) This documentation file and all other files included in the
TN-Image package, including the sample images and tutorial files,
must be included in their entirety whenever the program is distributed.
Any modifications of the documentation must be clearly indicated as such.
(2) The executable file TNIMAGE.EXE must not be modified in any way
without express written permission from the author.
(3) No algorithm used in this program or any part of the user
interface may be patented or trademarked by any party.
(4) No additional restrictions may be added to the above-mentioned
limitations. In particular, vendors, end users and distributors may
not be prohibited from distributing, uploading, or using the share-
ware version of this package without any charge or restriction other
than those stated in this license.
(5) TN-Image may also be distributed in any form, including CD-ROM,
on a commercial for-profit basis, as long as the package is clearly
marked as being "shareware" or "containing shareware items".
In contradistinction to conditions (4) and (5) above, the registered
version of TN-Image may not be distributed by any party without the
express written permission from the author. Inquiries regarding site
licenses, from commercial enterprises wishing to market this program,
or persons wishing to obtain a customized version of the program on
a contract basis should be directed to the above mail or e-mail address.
3.1.0 Differences between shareware and registered versions
The following applies only to the DOS version of TN-Image.
The main limitations of the shareware version is that it can only
handle two images at a time, and that advanced features such as
densitometry and 2D Fourier transforms are not available in the
shareware version. Some features that require creation of a new image,
such as image rotation, will not work if there are already two images
present. Functions such as Fourier deconvolution, which requires
several image buffers, will also not work. Reading and writing of
JPEG images, which requires virtual memory, does not work.
Depending on the amount of memory in your computer, some of the
higher resolution screen modes also may not work in the Shareware
version.
After registering your copy of TN-Image, you will receive a free
copy of the full TN-Image "Professional" version. This program
contains all the features of the shareware version, as well as the
following enhancements:
(1) Improved capacity - handles up to 512 images simultaneously
instead of only two.
(2) 2D-Fourier transform and Fourier convolution/deconvolution of
images. View the image "DECONVOL.TIF" for a brief tutorial on
2D-Fourier transforms, convolution, and deconvolution.
(3) A much wider selection of predefined palettes, as well as the
ability to interactively create new palettes, save, and load them
from disk.
(4) Many more types of filters (see Sec. 8.3.1).
(5) Virtual memory, for much larger file handling (up to 3.5 GB).
(6) New features which are constantly being added (see "Planned
Enhancements" below). By the time you read this, there will
certainly be many additional new features, most of which you
will unquestionably be in dire need of.
(7) Densitometry, area analysis, and peak area measurement.
View the images "DENSITOM.PCX" and "DENSITO2.TIF" for a tutorial
on these features.
(8) Ability to create custom file formats or save images in a
custom format.
(9) Reading and writing of JPEG files. JPEG is not included in the
shareware version because it requires virtual memory, and also
adds about 100k to the size of the program.
(10) Color and grayscale printing of images.
(11) Powerful macro language and batch mode operation.
(12) Registered users also are entitled to unlimited free technical
support via e-mail.
(13) Liberal upgrade policy (see below).
Note:
Because of the tremendous volume of registrations that we have
received, is is not possible to answer questions from
unregistered users unless you are having basic trouble such as
"blank screen", "won't start", etc.
An order blank is included in the file TNORDER.FRM.
3.2.0 Submitting bug reports
If TN-Image crashes, hangs, draws the screen incorrectly or fails
to read or write a valid image, it is probably a bug. I would greatly
appreciate receiving bug reports from all registered and unregistered
users. Bug reports should be sent to the above Internet e-mail address
for fastest response, or alternatively to the P.O. box listed above.
If you send a bug report, please run the command "tnimage -diag" first
and write down any relevant information. Also indicate your computer
type, video card, and monitor type, what resolution you are trying to
use, and the operating system and OS version you are using, and any
other relevant information. Most importantly, indicate what version
of TN-Image you are using, and the sequence of actions that cause the
problem. If the problem only occurs with a specific image, you may also
need to send a copy of the image file. The easiest way to do this is to
upload it by ftp into the 'uploads' directory on las2.ninds.nih.gov. All
bug reports will receive immediate attention. If you are a registered
user, you will also receive a replacement disk if I am able to reproduce
the bug.
3.3.0 Obtaining technical support
The following applies only to the DOS version of TN-Image.
Registered users can obtain technical support by sending e-mail to
the above Internet or Compuserve e-mail addresses, or by sending
regular mail to the P.O. box mentioned above. You will get the
fastest response using the Internet e-mail address.
4.0.0 Upgrade policy
The following applies only to the DOS version of TN-Image.
Registered users may receive an unlimited number of upgrades at
any time within two years of the date of registration, by sending
$5 to cover postage and diskette costs to the mailing address
above. Alternatively, you can request that the update be e-mailed (in
uuencoded format) to your e-mail address, or sent to your ftp server.
(It is not necessary to pay in this case.)
After the two year period, upgrades may be requested at any time,
for a price of 1/2 the original purchase price. You may request that
the upgrade be sent by e-mail, ftp, or by regular mail.
Read the file TNIMAGE.NEW, available at the ftp site, for news about
the latest features and changes in TN-Image.
5.0.0 System Requirements
TN-Image has the following minimum system requirements:
1. MS- or PC-DOS above version 3.2, Windows, or a supported
version of Unix with X11 (Unix version is available separately).
2. A minimum of 4 MB of RAM, preferably 8 MB. 8MB is strongly recommended
and may be required in future versions (If you have 4 MB of RAM
or less, see "Operating under low-memory conditions" below).
3. A computer with an 80386 or higher CPU. (TN-Image runs in protected
mode). A co-processor is recommended for 80386's if you will be
performing FFT's.
4. A Super VGA card with at least 1 MB of video memory, and capable
of handling 256 or more colors.
You MUST have at least 1 megabyte of video memory on your Super
VGA card to run TN-Image in 1024 x 768 pixel mode. (To run
TN-Image in lower-resolution modes, see "Command-line options"
below).
5. A super VGA monitor capable of displaying 256 colors. The
default screen mode for TN-Image is 800 x 600 pixels. If you don't
know whether your monitor can display at this resolution, it is
advisable to check first, either in your monitor documentation, or
using the diagnostics program that should have come with your video
card. WARNING: It is the responsibility of the video card, not this
program, to determine whether your monitor can handle any given screen
mode. The only way for the program to determine whether it is safe to
set a given screen mode is to query your video card. Unfortunately,
not all video cards respond with accurate information. If your video
card supports this screen mode but your monitor doesn't, you could
experience a computer crash or even (theoretically) damage your
monitor. This has never happened in all the months of extensive
testing of the program on a variety of monitors. Nonetheless:
THE AUTHOR ASSUMES NO RESPONSIBILITY FOR ANY PROBLEMS
CAUSED BY RUNNING THIS PROGRAM IN A COMPUTER WHICH HAS A
SUPER VGA CARD ATTACHED TO A REGULAR (NON-SUPER VGA) MONITOR!
If you have a super VGA monitor but it cannot handle 800x600 pixel
mode, TN-Image can also use other video modes. See "Command-line
options" below.
6. A mouse. It is advisable to obtain a mouse driver that is
compatible with super VGA modes, such as Logitech's mouse driver
version 6.12 or later. Earlier mouse drivers will work, but you
will not have as fine control of the mouse as with later versions.
A mouse driver is needed even if TN-Image is run in a Windows DOS box.
7. TN-Image should be run from a hard disk. If run from a floppy, do
not remove the floppy while the program is running.
8. A PCL laser or inkjet printer is required to obtain hard copies. (H/P
Laserjet IV compatible or a similar 600 dpi laser printer is recommended).
A 300 dpi printer will also work, but will give inferior quality prints.
A H/P compatible color laser or inkjet printer is required for color
printing.
6.0.0 Overview
TN-Image is an image editing program for PC-compatibles. You can
read and write image files from disk, edit and combine them, add
text or various graphic elements, adjust the colors, perform
densitometry, quantitatively scan trapezoidal regions or lines in
the image, draw graphs, and print images at several resolutions.
Unlike the image editing programs which run under Windows, or those
which may come with a scanner, TN-Image allows you to view 8- to
32-bit images in their entirety.
Images are stored in RAM and on disk using virtual memory. This
means that if the program begins to run slowly, it is probably due
to insufficient RAM. Up to 512 different images can be edited and
be on the screen simultaneously (2 in the Shareware version). This
limit may be lower if you have limited RAM and disk space. You can
obtain more virtual memory by using a disk utility to unfragment
your hard disk. Images can overlap without interfering with each
other or the background. You can use the mouse to scroll through
the image in adjustable steps.
6.1.0 Image file types supported
TN-Image reads and writes image files in TIF, JPEG, PCX, TGA, BMP, as
well as the IMA format produced by the publication-quality graphics
shareware program NPLOT (available at the ftp sites las2.ninds.nih.gov
and las1.ninds.nih.gov) and the IMG format produced by frame-grabbers,
as well as GEM IMG and several others listed below. Any other generic
file type can also be read, provided that:
1. you know the number of x and y pixels in the image
2. you know the no. of bits per pixel.
3. the image stores its pixels in the usual scanning order (left
to right, top to bottom).
In addition, you can create new image file formats to read and write
images in virtually any uncompressed format that uses fixed-size
headers.
The IMG format produced by TN-Image is the same as that produced by
most frame grabbers: 4 bytes indicating the x and y size, followed
by the image data. This is not the same as the GEM "IMG" format,
which is seldom used for image analysis. TN-Image can read GEM IMG
Raster files, however.
For densitometry, it is recommended that images be stored in TIF
format because this format allows the image to provide a calibration
curve to accurately convert pixel intensity to optical density (O.D.).
This is important for quantitative applications. Most scanners provide
this information. If not, TN-Image will still function, but the results
will be in uncorrected pixel intensity values instead of O.D. (This
consideration does not apply for color images).
***NOTE*** Targa (TGA) files must have the extension .TGA to be readable.
***NOTE ON COMPRESSED TIF FILES***
As of Version 2.11, creation of compressed TIF image files is not
supported in TN-Image. LZW- and PackBits-compressed TIF files are,
however, readable. The reason for this discrepancy is the choice
by Aldus Corporation of LZW compression, which is patented by Unisys,
for the compression algorithm. The most recent TIFF documentation
indicates that LZW is now being phased out of TIFF. This means that
LZW-compressed TIF files will no longer be a valid image format.
Technical information -
The following file subtypes/features in all valid permutations have
been tested to be readable by TN-Image:
TIFF files:
1 to 32 bit/pixel TIF-B,G,P, and R files
(B=black/white, G=gray scale, P=palette color, R=RGB full color)
Tiles/Strips/CMYK
Intel and Macintosh TIF
PCX files:
1,2,4,and 8 bit/pixel PCX
IMG files:
1,2,4,and 8 bit/pixel IMG
Other:
4 bit IMA (from VGA or EGA mode NPLOT and NPDATA)
Unformatted 1 to 32 bit/pixel raw binary images (color
and monochrome)
JPEG:
Color JPG (JFIF) (registered version only)
Targa:
8, 16, and 24 bit/pixel TGA
BMP:
4,8, and 24 bit BMP (Windows 3.x subtype)
GIF
GEM IMG
The following file subtypes can be created by TN-Image:
1 to 32 bit PC TIF-B,G,P,and R, incl. CMYK extension(uncompressed)
1 to 32 bit raw bytes
1 to 32 bit custom files for PC, Mac, and MVS mainframe OS's
1 and 8 bit PCX
1 and 8 bit IMG
24 bit JPG (JFIF subtype) (registered version only)
8,16, and 24 bit TGA
8 and 24 bit BMP (Windows 3.x subtype)
The following file types may be also supported if enough requests are
received:
Creation of 1 to 32 bit Mac TIF
OS/2 BMP
PNG
6.2.0 Pixel intensities
When you move the mouse in TN-Image, the upper right part of the menu
bar shows the x and y coordinates and the value of the pixel at the
mouse position. This is convenient when manipulating the image, since
image manipulation uses simple mathematical functions to transform
the image. Thus, to make the image lighter, you can "add" a value
of 50 to each pixel. To increase contrast, you can multiply each
pixel value by a constant factor. This ensures that quantitative
manipulations on the image remain directly traceable to the
original data.
6.3.0 Description of Menu Bars (DOS Version)
TN-Image displays a variety of information in the menu bars. One
or both of these lines can be hidden to create a less cluttered
display. The menus are still active even when the menu bars are
hidden.
Top line:
File Image..etc - The main menus - use the mouse to select
the desired option.
˛ - Foreground color indicator
- Clicking on these small triangles will
move the topmost image in the indicated
direction. The distance is determined
by the "Cursor movement rate" (see below).
r255g255b255 - The red, green, and blue components of
the current pixel, i.e., the pixel the
mouse is pointing to. For 8 bit/pixel
images, the red, green, and blue components
of the palette entry for that color are
shown.
i=32767 - The intensity value of the current pixel,
This is only displayed if TN-Image is in
a mode with a wide enough screen width.
This value will be different for images
with different numbers of bits per pixel.
Second line:
0.12345 - The current pixel value, scaled from 0 to 1
and corrected for bits/pixel of the point.
123 456 - The next 2 numbers are the x and y
coordinates of the current pixel.
Size 8 - The cursor movement rate. This is the
distance by which the mouse will move when
an arrow key is pressed, and the distance
an image will move when you click one of
the small triangles. The cursor size can
be changed by pressing the gray (+) or (-)
keys, or selecting "Configure...
Cursor movement rate".
8 bpp - The bits per pixel of the current pixel,
calculated for the topmost image.
16 bits/pixel - The rightmost item is the bits/pixel of
the screen.
------------ - A click box is visible when the program
| Vertical | is in a state such as "vertical text" mode
------------ or "drawing" mode. Clicking on this box
returns to normal mode.
6.4.0 Tutorial files
Five tutorial files are included with TN-Image:
DENSITOM.PCX - an image file demonstrating strip densitometry.
DENSITO2.TIF - an image file demonstrating spot densitometry.
DECONVOL.TIF - an image file demonstrating convolution and
deconvolution using FFT (Part 1).
DECONVO2.TIF - an image file demonstrating convolution and
deconvolution using FFT (Part 2). (Included in
registered version).
FILTER.TIF - an image file demonstrating digital filtering
using FFT.
7.0.0 Operation
To start TN-Image, type TNIMAGE. If VESA BIOS is present, TN-Image
will run using the functions defined in the VESA specification.
Otherwise, TN-Image will try to use video card-specific functions.
If no VESA BIOS is present and the card is unsupported, TN-Image
will terminate. VESA 1.2 or above is required to run in 15-, 16-,
24-, and 32-bit/pixel color modes, since in the earlier VESA specif-
ication, modes 110 to 11b were text modes.
7.1.0 Command-line options (DOS version)
-n = Skip introductory screen in 8-bit modes.
-vesa = forces TN-Image to use VESA BIOS even for Trident or
Tseng Labs cards.
-oldvesa = forces TN-Image to use functions for version 1.0 VESA
BIOS (slightly slower, but required on some cards).
-trident = Forces TN-Image to use Trident-specific calls, even
if VESA BIOS is present.
-tseng = Forces TN-Image to use Tseng-specific calls, even if
VESA BIOS is present.
-diamond = Forces TN-Image to use Tseng-specific calls, even if
VESA BIOS is present and sets the program to use
Diamond Speedstar mode. This option is experimental and
will be subsumed under the "Tseng" option after we obtain
a Tseng-based Diamond card for testing. Feedback as to
whether this option actually works will be appreciated.
-w32 = Forces TN-Image to use Tseng-specific calls, even if
VESA BIOS is present and sets the program to use
W32 chip mode. This option is experimental and
will be subsumed under the "Tseng" option after we obtain
a card with the Tseng ET4000W32 chip for testing.
Feedback as to whether this option works will be
appreciated.
-S3 = Force TN-Image to control these chips directly, even if
-ATI VESA BIOS is present. NOT CURRENTLY IMPLEMENTED.
-XGA
-diag = Diagnostic mode (Prints status messages at each stage
or of setting your video mode). Useful if you have
-diagnose difficulty starting TN-Image on your computer. At each
step, you need to press a key to continue. PLEASE
REPORT THIS INFORMATION WHEN REQUESTING TECHNICAL
ASSISTANCE.
-fyu = This option is for debugging use only.
-macro <macro_file>
= Automatically runs the specified macro file. See "Batch
mode processing"
-files <file_list>
= Specifies a list of image files to be automatically
loaded. Using a text editor, create an ordinary text
file containing a list of the files to be read, with one
filename on each line, for example:
t*.tif
c:\images\abc.bmp
hubble.img
Then start TN-Image with the command:
tnimage -files test.lst
substituting the name of your list for "test.lst". Do
not put a dash before the filename of the list file.
Wildcard characters such as '*' or '?' are also
permissible. Up to 512 images can be loaded from
the list file (if you have the Registered version).
If you only need to load a few files, it may be easier to
use the "<filename>" option (below) instead.
<filename> <filename> ...
= Reads the specified file(s). You can load as many files
as you can cram onto the DOS command line.
If you have a large number of files, it may be easier
to use the "-files" option (above).
Do not precede the filename with a dash ("-"). Filenames
may contain path specifications and wild cards (* or ?).
Examples:
TNIMAGE my.gif = Loads my.gif
TNIMAGE *.tif = Loads all TIF files in
current directory.
TNIMAGE c:\images\*.tif b:\abc.img
= Loads all TIF files from
the C:\images directory,
then file abc.img from
drive B.
tnimage -mode 103 *.tif -files file.lst -vesa
= Any combination of command
line options is also accept-
able.
-mode xxx = Start up in screen mode xxx, where xxx is a
hexadecimal number indicating the desired screen mode
(see below).
Some monitors cannot handle the highest resolution modes
and will fail to `sync' or display a white screen.
If this happens, press Alt-X two or three times to escape
from the program. You can determine which screen modes
your computer can handle by checking in the manual that
came with your video card and monitor. READ THE WARNING
BELOW BEFORE USING THIS OPTION!
Example: tnimage -mode 111
-xres xxx = Start up in a VESA screen mode with x resolution of xxx,
where xxx is the no. of horizontal pixels to display
per scan line. 8 bits/pixel is automatically selected
unless specified with the -bpp option.
Some monitors cannot handle the highest resolution modes
and will fail to `sync' or display a white screen.
If this happens, press Alt-X two or three times to escape
from the program. You can determine which screen modes
your computer can handle by checking in the manual that
came with your video card and monitor. READ THE WARNING
BELOW BEFORE USING THIS OPTION!
-bpp xxx = Start up in a VESA screen mode of xxx bits/pixel. (Used
in conjunction with the -xres option).
? or = List the available screen modes.
-?
The options can be in any order, except that if a parameter
is needed, it must follow the option.
The arguments must be separated by spaces.
Examples:
To run TN-Image in VESA 1024x768 mode, type:
TNIMAGE -vesa -mode 105 <Enter>
or
TNIMAGE -mode 105 (The word "Vesa" is only
required if you happen
to have a Tseng or
Trident chip and you
want to bypass direct
chip addressing).
If you have an old card, specifying "-vesa" will cause display
problems. If problems occur, use:
TNIMAGE -oldvesa
or
TNIMAGE -oldvesa -mode 105 to select 1024x768 mode.
To run TN-Image on a computer equipped with a
Trident card, in 640 x 480 mode, type:
TNIMAGE -mode 5d
or
TNIMAGE -trident -mode 5d
To run TN-Image on a computer equipped with a card
containing a Tseng Labs ET4000 chip, in 800 x 600 mode, type:
TNIMAGE -mode 30
or
TNIMAGE -tseng -mode 30
To run TN-Image and automatically load and display
the image "test.img", type
TNIMAGE test.img
or
TNIMAGE -file test.img
To run TN-Image in a 1600 x 1200 resolution at 8 bits/pixel, type:
TNIMAGE -xres 1600
or
TNIMAGE -xres 1600 -bpp 8
To run TN-Image in a 1600 x 1200 resolution at 24 bits/pixel (true
color), type:
TNIMAGE -xres 1600 -bpp 24
The command line options are stored in the file TN-Image.INI,
so the next time you start TN-Image, it is not necessary to
specify the screen mode.
7.1.1 Unix Command-line options
-n = Skip introductory screen in 8-bit modes.
-fyu = This option is for debugging use only.
-macro <macro_file>
= Automatically runs the specified macro file. See "Batch
mode processing"
-files <file_list>
= Specifies a list of image files to be automatically
loaded. Using a text editor, create an ordinary text
file containing a list of the files to be read, with one
filename on each line, for example:
t*.tif
~/images/abc.bmp
hubble.img
Then start TN-Image with the command:
xtnimage -files test.lst
substituting the name of your list for "test.lst". Do
not put a dash before the filename of the list file.
Wildcard characters such as '*' or '?' are also
permissible. Up to 512 images can be loaded from
the list file (if you have the Registered version).
If you only need to load a few files, it may be easier to
use the "<filename>" option (below) instead.
<filename> <filename> ...
= Reads the specified file(s). You can load as many files
as you can cram onto the DOS command line.
If you have a large number of files, it may be easier
to use the "-files" option (above).
Do not precede the filename with a dash ("-"). Filenames
may contain path specifications and wild cards (* or ?).
Examples:
xtnimage my.gif = Loads my.gif
xtnimage *.tif = Loads all TIF files in
current directory.
xtnimage ~/images/*.tif /mnt/abc.img
= Loads all TIF files from
the /images directory,
then file abc.img from
/mnt.
Any combination of command
line options is also accept-
able.
? or = List the available options.
-?
-fg or -foreground = Specify foreground color
-bg or -background = Specify background color
Example: xtnimage -fg white -bg MistyRose3 &
-geometry <geometry-string>
Example: xtnimage -geometry 400x500+100+100
-display <screen-IP-address>
Example: xtnimage -display 192.168.1.1:0.0 &
See ' man X ' for more details.
The options can be in any order, except that if a parameter
is needed, it must follow the option.
The arguments must be separated by spaces.
To run TN-Image and automatically load and display
the image "test.img", type
xtnimage test.img
7.2.0 Video cards supported (DOS version)
Currently two SVGA chips are directly supported:
a) Trident 8800, 8900, or more recent chips. Trident cards seem
to be popular in many local computer stores.
b) Tseng Labs ET4000 or more recent chips. Note: the older Tseng
ET3000 chip is not supported. The ET4000 chip is in many cards
made by a variety of manufacturers.
If these two chips are not detected, TN-Image will use VESA
super VGA functions.
Other cards will also work if they are VESA-compatible. To use a
VESA-compatible card, you may need to first install a VESA BIOS
extension, which is usually a small program that came with your
video card, and may be named "VVESA.COM" (for Mach32 cards),
"VESART.COM" (for Realtek cards), or something similar.
Installing this VESA BIOS means you have to run the VESA program
before running TNEDIT. This is conveniently done by putting it
in your AUTOEXEC.BAT file. Newer cards often have VESA already
installed in the card in ROM so no action needs to be taken.
Certain early video cards interact with the mouse cursor, making
smooth movement of the mouse difficult. Some older mouse drivers
also cannot handle SVGA modes smoothly. It should be possible to
position the mouse at each point on the screen. If you
experience difficulty reaching odd-numbered pixels, try to
obtain a newer mouse driver. If this doesn't help, it may be
necessary to upgrade to a better SVGA card. This problem is
known to occur with some RTG3106-based Realtek cards.
If you have one of the above video cards and TN-Image still
doesn't work on your computer, please let us know. We will try
to fix it for you.
ATI video card users:
Computers with Mach 32 ATI cards may have problems running TN-Image
in true-color modes from within a DOS box. The only known solution
is to run TN-Image from DOS, or use TN-Image in an 8 bit/pixel
mode (e.g., mode 103). (See "Command-line options" above).
If your ATI video card won't go into desired screen mode, even though
the manual states that mode is supported, run ATI's "Install" program
again to verify the specified video mode is activated. If this doesn't
work, it is possible that the computer was turned on before turning on
the power to the monitor. ATI cards only examine the monitor type at
power-up, and could become confused if the monitor is off during a cold
boot-up, and refuse to set high-resolution modes.
The display in TN-Image is corrupted when using ATI Mach 64 cards
if the UNIVBE TSR is present.
7.3.0 Screen modes supported (DOS version)
************************* WARNING! ****************************
CHECK YOUR MONITOR MANUAL *BEFORE* ATTEMPTING TO RUN TN-IMAGE
IN A SCREEN MODE OTHER THAN THE DEFAULT MODE! THE AUTHOR IS
NOT RESPONSIBLE FOR ANY MONITOR DAMAGE CAUSED BY ATTEMPTING TO
SET YOUR MONITOR TO A MODE WHICH IT IS UNABLE TO HANDLE. MOST
VIDEO CARDS WILL REFUSE TO SET AN UNSAFE MODE, BUT SOME WILL!
**************************************************************
The mode value `xxx' on the command line can be one of the following:
Video card/chip Mode Resolution Colors Video RAM Bits per
Needed Pixelÿ
--------------- ------ ---------- -------- --------- --------
Tseng ET4000/W32 2E 640 x 480 256 1/2 meg 8
30 800 x 600 256 1/2 meg 8
38 1024 x 768 256 1 meg 8
2E1 + 640 x 480 32,768 1 meg 15
301 + 800 x 600 32,768 1 meg 15
381 + 1024 x 768 32,768 2 meg 15
2E2 + 640 x 480 65,536 1 meg 16
302 + 800 x 600 65,536 1 meg 16
382 + 1024 x 768 65,536 2 meg 16
2E3 + 640 x 480 16,777,216 1 meg 24
303 + 800 x 600 16,777,216 2 meg 24
383 + 1024 x 768 16,777,216 3 meg 24
Trident 8800/8900 5D 640 x 480 256 1/2 meg 8
5E 800 x 600 256 1/2 meg 8
62 1024 x 768 256 1 meg 8
VESA 100 640 x 400 256˝ 256 k 8
101 640 x 480 256 1/2 meg 8
103 800 x 600 256 1/2 meg 8
105 1024 x 768 256 1 meg 8
107 1280 x 1024 256 2 meg 8
110 640 x 480 32,768˝ 1 meg 15
111 640 x 480 65,536 1 meg 16
112 640 x 480 16,777,216 1 meg 24-32
113 800 x 600 32,768˝ 1 meg 15
114 800 x 600 65,536 1 meg 16
115 800 x 600 16,777,216* 2 meg 24-32
116 1024 x 768 32,768˝ 2 meg 15
117 1024 x 768 65,536 2 meg 16
118 1024 x 768 16,777,216* 3 meg 24-32
119 1280 x 1024 32,768˝ 3 meg 15
11a 1280 x 1024 65,536 3 meg 16
11b 1280 x 1024 16,777,216* 4 meg 24-32
120◊ 1600 x 1200 256 2 meg 8
1600 x 1200 65,536 4 meg 16
1600 x 1200 16,777,216* 6 meg 24-32
* Most cards use mode 115, 118, and 11b as 32-bit/pixel
modes for speed purposes, but the maximum no.of colors
is still only 16,777,216.
+ Experimental - awaiting testing with W32 card.
Any feedback as to whether these modes work is
appreciated.
ÿ Some video cards, such as the #9GXE, do not support any 15-bit
screen modes.
˝ #9GXE64 card does not support this mode.
◊ Numbering for screen modes above 11b may vary from card to card.
All VESA modes with 8 or more bits/pixel are available using the
-xres and -bpp options (Sec.7.1.0).
If after trying the above options, you still cannot get TN-Image
to run on your machine, you can try utilities such as UNIVBE,
which can permit your Super VGA card to use VESA modes.
If your monitor makes a buzzing or squeaking sound and/or fails to
synchronize (evidenced by jagged diagonal lines or other unusual
effects), turn the monitor off immediately and press Alt-X several
times to stop the program. This could occur if your video card reports
that it is safe to set a given screen mode when in fact it is not
safe. Although it should be the responsibility of the video card to
determine whether it is safe to set a given screen mode, this
feature is absent from many cards. All SVGA monitors, however,
should be capable of running safely at the default screen mode
(800x600 pixels).
===========================================================================
7.4.0 Basic operations
Most operations, such as filtering, saving images to disk, etc. use
a "selected region" which has to be selected before you perform the
operation. To select a region, move the mouse to one corner of the
desired area, click and drag to the other corner, then release the
mouse button. A rectangle shows the selected region while you are
dragging. This selected region stays in effect until you (1) quit
the program, (2) select another region, (3) pick "unselect region"
from the menu, or (4) double-click on an image to select an entire
image. If no region has been selected, or it was unselected, the
region defaults to the entire screen. If you make changes to or
select a region that is partly on an image and partly on the
background, the portion of your changes that falls on the image
will remain with the image, and the rest will stick to the
background.
The background is maintained independently of the images. Thus, if
an image is moved over the background or another image, the
background is not disturbed. When many images are simultaneously
present, it is often convenient to keep most of them out of the way
by stacking them up or moving them out of the visible region, off
the edge of the screen. If an image gets lost off the edge, you can
find its coordinates by selecting "About the program" or "About the
image".
You can select an entire image by double-clicking on that image. To
change to a different image, single-click on the other image to
bring it to the foreground or double-click on it to select it.
Selecting an image means that, all subsequent operations will be
performed on the entirety of that image.
You can move an image around by clicking on the small arrows on the
top menu bar. The distance by which a single click on the arrow
moves the image is adjustable by pressing the gray "+" or "-" keys,
or by selecting "Cursor movement rate" from the "Configuration" menu.
When the mouse cursor passes over an edge of an image, it changes
from a diagonal arrow to double arrows. If you click the left mouse
button at this point, the image will be "grabbed". Keep pressing
the mouse button, move to a new location, and then release. The
image is then moved to the new location. The same is true for mess-
age boxes, graphs, dialog boxes, the color palette window, and in-
formation windows.
=========================================================================
7.5.0 Operating under low-memory conditions
If you have 4 MB or less of RAM, or use large images or a lot of
images simultaneously, or work in a Windows DOS box, eventually you
may run out of memory.
There are several things you can do to increase available memory:
(1) In the "Config" menu, turn off the "Automatic undo" option
before loading any images. This will double the amount of space
available for images, but TN-Image will not create an "undo" buffer
for each image. This means you will not be able to erase anything
from the image (such as text or graphic elements) without creating
blank areas on the image. You can still back up and restore images
manually, however.
(2) Start TN-Image in a lower screen mode. In lower resolution
modes, less memory is needed to manipulate images and background.
(See under "Command-line options"). Try using 8-bit/pixel modes
instead of true color modes. TN-Image reserves a fixed amount of
memory for drawing dialog boxes and error messages. The amount of
reserved memory is also screen mode-dependent.
(3) In TN-Image registered version, memory is limited only by the
available hard disk space. You can create more virtual memory by
using a disk utility to unfragment your hard disk, or you can erase
unneeded files.
(4) If high resolution is not essential, images can be loaded in a
small size. Loading an image with "X size=50" and "Y size=50"
uses only ¨ as much memory as a full-size image. (See under
"File menu...Load image").
(5). If you have more than one image loaded, unload one of the
images using "File... Unload image". This removes it and its backup
from memory.
(6). Erase FFT's as soon as possible by selecting "File...Erase FFT".
Fourier transforms use large amounts of memory.
7.6.0 Commonly asked questions
Q. How do I add text?
A. Move the mouse cursor to the desired location and begin typing.
It is not necessary to click the mouse before typing. Make sure
the mouse does not move while you are typing. The text will stick
to the foremost image, or if no image is present, to the background.
Unix versions can also select the font, font size, and weight.
Q. How do I undo an operation?
A. Select "Process...Restore". The image will be restored to its state
at the last time you backed it up. If you never backed it up, it will
be restored to its original state -- unless the "Auto-Undo" option
has been turned off.
Q. How do I turn off box- or line-drawing mode?
A. Click anywhere on the top menu bar or pull down any menu. This
automatically turns off everything. Alternatively, click on the
small rectangle which displays the current mode on the right side
of the menu bar.
Q. Is there an easy way to change the color of text, lines, etc.?
A. Yes, click the left mouse button on the palette to select the
foreground color. Click the right mouse button on the palette to
select the background color.
Q. When filtering, changing contrast, etc. of color images, why does
junk sometimes briefly appear on the screen?
A. If TN-Image is in an 8-bit screen mode, manipulating 16 and 24-bit
images temporarily causes the image to be filled with 16 or 24 bit
data, which appears as random noise because of the discontinuous
palette. After the operation is finished, the palette is automatically
recalculated, and the image will appear normal again.
Q. How can I combine two or more pseudocolor images into one image so
that they have the same palette?
A. Start TN-Image in a color mode by typing: tnimage -xres 800 -bpp 24
(for example). Load both images, then select "Create image" and select
a region covering both images, using the mouse. Select "Change
image depth" to convert the image to 1 byte (8 bits) per pixel. A new
8-bit palette will be generated to fit both images.
Q. Why is <xxx> image file format not supported?
A. Some image formats (such as GEM IMG) are not commonly used in image
analysis. Others (such as lossless JPEG, LZW-compressed TIF, and
creation of GIFs) are not supported because of patent restrictions.
JPEG is not included in the Shareware version because it requires
virtual memory. Requests for other formats are welcome.
Q. Is a Windows-9x version of TN-Image being planned?
A. This has not been decided. For now, TN-Image has an icon and PIF file,
and works perfectly in a DOS box. TN-Image is very demanding on the
hardware and will always run better from the DOS command line than
in Windows.
Q. Is a Windows-3.1 version of TN-Image being planned?
A. No.
Q. Is a Macintosh version of TN-Image being planned?
A. No.
Q. Is a Unix (X-Window) version of TN-Image being planned?
A. TN-Image is currently being ported to the X Window system. Several
UNIX versions, including Irix, SunOS, and Linux will be available.
Contact the author for availability dates. Registered users will be
able to obtain a free copy by ftp or by mail for a nominal charge.
Q. Will lower-resolution screen modes (such as 640 x 480 x 16 colors)
ever be supported?
A. No. Reducing the number of colors to 16 would render any quantitative
analysis of the image almost meaningless. Users are advised against
using 4-bit images for any scientific work, as many such images that
have previously appeared in the literature are now being questioned.
7.7.0 Batch mode processing
TN-Image can also be run in "batch" mode for unattended operation.
This is useful for operations that are time-consuming or need to be done
every day. You can use a cron-like utility or a DOS command scheduler
such as TNSHELL (available from the author) to automatically carry out
any sequence of operations at (for example) 3 a.m. on Thursdays or to
automatically load a series of images before you come to work. The
computer's mouse and video card must still be present, and if your monitor
is turned on the images will still appear on the display.
Procedure:
1. Create a macro in TN-Image and save it to disk. The last command in
the macro should be "exit" to ensure TN-Image quits when finished.
The command "messages 0" can also be used to ensure that any error
messages are ignored instead of causing the program to wait for an
acknowledgement (Make sure the macro works before using this!).
2. Using TNSHELL (or other program), set the following DOS command to
be executed at the desired time (e.g., 3 a.m. every Saturday):
TNIMAGE -MACRO <macro_file>
where <macro_file> is the name of your macro (without brackets).
See "Macro programming guide" for examples of useful batch macros.
7.8.0 Editing text files
The Macro Editor in TN-Image can also be used as a text editor for small
(up to 256 lines) text files. This can be used to take notes on your
image analysis, create color-remapping files, etc. as well as writing
macros.
=========================================================================
8.0.0 Menu options
Menus, dialog boxes, message boxes, and click boxes can all be moved
by moving the mouse to the edge of the object and clicking the
left mouse button. Move to the desired location and release the
mouse button.
8.1.0 File menu
8.1.1 Load image
Reads an image from a disk file.
Vertical/Horizontal - Selects whether the image should be
loaded in its normal orientation
(vertical) or rotated 90¯ (horizontal).
Positive/Negative - Selects whether the image is to be loaded
normally or as a negative (color-inverted)
image.
Filename - Name of the image to be read. The previous
20 filenames are kept on a stack and can be
selected with the up and down arrow keys.
Alternatively, if you press <Enter> when no
filename is showing, you can select a file
from a menu. Wildcard (* or ?) characters
are permissible; thus, "*.pcx" is a valid
filename, and will cause all matching files
to be loaded.
X position - Horizontal starting pixel position to place
the image (in pixels).
Y position - Vertical starting position to place the
image (in pixels).
X size - If x size is 100, the image is loaded in
its actual size. If set to some value
between 0 and 100, the image is shrunk in
the x direction.
Y size - If y size is 100, the image is loaded in
its actual size. If set to some value
between 0 and 100, the image is shrunk in
the y direction.
Auto File Type/ Raw bytes -
Select `raw bytes' if you wish to read the image as a series of
bytes and override the automatic image file type detection. (If
the image is an unknown format, "raw bytes" mode is selected
automatically).
Invert byte order -
Certain other imaging programs save the RGB values in the wrong
order. This could also happen with certain video cards.
Clicking this option will switch the byte order to the correct
value.
CMYK->RGB -
If the TIF file happens to be a 32-bit CMYK image, TN-Image
will automatically convert it to RGB format for display
purposes. Occasionally, an image file header says the image is
a CMYK image but in actuality it is not. Un-clicking this
option will cause TN-Image to treat the image as if it were an
ordinary RGB image. This option has no effect on images less
than 32 bits/pixel.
Convert to gray scale
Changes the image to shades of gray instead of its original
colors. This is particularly useful for CT or MRI images of greater
than 8 bits per pixel, because the gray scale can be remapped
as a "sliding scale" to enhance specific regions of the image.
Color reduction -
Quantization/Fit current palette/None
If TN-Image is in an 8-bit/pixel (indexed-color) mode, when a
color image is loaded the number of colors must be reduced to
256 for display purposes. This can be done by "quantizing" the
image or by trying to fit the image to the currently-selected
palette. Even though the quantization algorithm used is new and
one of the fastest known, converting the image to 8 bits/pixel
often still takes much longer than reading it from the disk.
Quantizing is more general than palette fitting, and is guar-
anteed to give a viewable image. Many GIF files were produced
with quantizing. However, because it changes the palette, all
other images currently being viewed will become "garbage" if
TN-Image is in an 8-bit mode (Of course they are not really
garbage, but temporarily unviewable). Clicking on an image restores
the palette for that image.
Palette fitting uses less memory than quantizing. If the error
message "Insufficient memory to convert to 8 bits/pixel" appears,
try changing the color reduction method to "fit current palette".
This can be quite slow, however, for certain types of images.
Because quantized palettes are usually not a continuous flow
of colors, it may not always be possible to perform all types of
quantitative analysis or filtering on a quantized 8-bit image.
The best solution is to select "Change color depth" and convert
the image to a 24 bits/pixel color image. The colors will then
work as expected during filtering.
Fitting to the current palette does not affect the other
images on the screen, and gives a result that is still
quantitatively analyzable and filterable. Also, if the original
colors in the image are similar to those in the palette, the
result will be a much smoother image. However, if the palette
is substantially different, none of the colors may match up.
(Of course, you can easily change the palette and repeat). This
method incidentally uses much less memory than quantizing.
If TN-Image is in a color mode, this option has no effect
except when saving images to disk when "8-bit/pixel palette" is
specified as the file type. Color images are filtered in an
identical manner regardless of whether or not TN-Image is in a
color mode. The palette is also used in color modes when an
image with 8 or less bits/pixel (i.e., a indexed-color image)
is loaded.
All 8,16,24, and 32-bit images are kept in memory in their
original color depth, regardless of the current screen mode.
Other images are converted at read time to the next highest
multiple of 8. This means that you can safely edit full-color
images even if your computer's video card can only handle 256
colors. Editing operations also are handled in a manner approp-
riate for each image. Thus, for example, you can select an area
encompassing both an 8-bit image and a 24-bit image, and filter
them simultaneously, with no problems. TN-Image automatically
knows the color depth of each pixel being processed and handles
it appropriately.
See also under "Color settings" for more details.
Images between 1 and 7 bits/pixel are automatically converted
to 8 or 16 bits/pixel when they are loaded. The conversion
makes use of whichever palette is selected. If you have not
specifically changed the palette, the default "spectrum" palette
will be used. This can result in an unexpected color appearance.
8 bit/pixel images are a special case, because they are usually
saved with their own palette.
If TN-Image cannot identify the image type, or finds an invalid
file, it asks if you want to try to read it anyway as raw bytes.
It then makes a guess as to the x and y sizes, and bits/pixel.
You should correct these as needed. In order to read raw bytes,
the image should have a constant no. of bytes per scan line, be
uncompressed, and have the image rows stored in consecutive
order. You may also have to skip a number of bytes to get the
image to line up horizontally. This number has to be determined
experimentally. If the file is not really an image file, in all
likelihood you will just get junk on the screen.
This feature allows you to import other types of files that are
not normally thought of as images. For example, to read a
database of 16 x 16 Chinese characters, use the following
parameters:
Filename: ziku (or name of the database)
x pixels: 16
y pixels: <length of file ˆ 16 > , e.g. 15000 or so.
bits/pixel: 1
bytes to skip: 0
The database will be loaded as a long strip of Chinese
characters, which then can be cut and pasted as desired. Of
course, this is not the most efficient way to edit Chinese, but
it demonstrates the usefulness of the feature.
See the following section for a detailed procedure for reading
raw bytes and creating custom formats.
If a single-color image containing between 1 and 8 bits/pixel is
loaded, the values are automatically filtered through the currently-
selected palette. If the image itself contains a palette, the palette
in the image is used. This is not done for single-color images greater
than 8 bits/pixel, because of the large size of the palette table that
would be required (usually, only 8-bit images actually contain a
palette).
8.1.1.1 Reading CT, X-ray, or MRI images, or raw bytes
Below is a detailed example for reading images produced by X-ray,
CT or nuclear magnetic resonance scanners and other equipment. These
machines typically use unusual file formats not recognized by TN-Image,
but usually the images can easily be read as "raw bytes".
The same procedure is applicable to any non-compressed file of
unknown type.
NOTE:
The Registered version of TN-Image can be used to create a "custom"
image file format, which is a superior method for reading medical image
files, because once the custom format is set up, reading the image is
transparent to the user, obviating the necessity for reading "raw
bytes" as described here (See "Create File Format").
(1) Select "File...Load image" and enter the image file name.
(2) Click on "Raw bytes".
(3) Click on "OK".
(4) TN-Image will make a guess at the image width. If the image width
is known, enter the image width and height. Otherwise, if the guess
turns out to be wrong, use the auto-increment method described below
to determine the width. In this case, the width happens to be 381.
(5) Select the bits/pixel of the image. This is usually 12 or 16 for
CT images (MAMOGRAM.LUM is 16 bits).
(6) (Optional): If the length of the image file header is known,
enter this value under "skip bytes". Otherwise, leave it as 0.
(7) Click on "OK" to load the image.
(8) Once the image is loaded, if the skip bytes were incorrect in
step 6, the image border will be visible as a vertical strip in
the image. Use the mouse to locate the X-position of this strip.
Unload the image and re-load it, using the X-position * bytes/pixel
as an estimage for skip bytes.
(10) If the image was color, it may be necessary to add 1,2, or 3
additional skip bytes to get the colors to line up correctly.
(11) If the image is grayscale, the grayscale mapping can be adjusted
by selecting "Color...Change palette...Grayscale brightness/
contrast". This allows you to interactively adjust the appearance
of the image as a sliding scale, to highlight areas of different
intensity (See "Grayscale brightness" below).
(12) The image can now be saved in a conventional file format.
Determining the width of an unknown image:
TN-Image has a unique feature for determining the width of an
image whose dimensions are completely unknown. This procedure is
substituted for step (4) above:
(4a) Make a conservative guess of the image width. For instance, if
the image is known to be square, and it is 16 bits (2 bytes)
per pixel, use
width = sqrt( file size / 2 )
as your starting estimate.
(4b) Click on "Auto increment". This will cause the width to be
increased with each scan line.
(4c) For "Increment", enter "1" or "2".
(4d) Click on "OK" to load the image. The image should consist of
a swirling pattern, with fuzzy lines in a horizontal "U" shape
like this:
\\\ \ \\
\\\ \ \\
\\\ \ \\*
/// / //
/// / //
Usually, the image is slightly clearer at the vertex (marked
with a *). If so, find the Y-coordinate of the vertex using
the mouse. Subtract 32 (the size of the menu bar) from this
value and add the result to your previous estimate of the
image width.
(4e) Unload the image.
(4f) Turn off "Auto increment" and load the image again. The image
should now be recognizable. If the image slopes to the right
as you move down the screen, this means the value is still too
low. Increase the image width slightly and try again. If it
slopes left, the value is too high.
If the image is still not recognizable after these steps,
try changing the byte order, or check the "Convert->gray scale"
option.
If you selected the wrong number of bits/pixel or y size for
a "raw bytes" image, the automatic grayscale detection
may estimate tne maximum and minimum gray levels incorrectly.
This will result in an image that is too dark or too light.
This can be easily corrected by remapping the gray levels
(See "Grayscale intensity mapping").
8.1.1.2 Reading Imaging Systems format files
The .IMG files produced by software from Imaging Systems Co. are
readable by TN-Image; however, their 4-byte header gives a value
for the image width that is off by 1. Thus, in order to read the
image properly, it is necessary to read the image as "raw bytes".
After manually changing the width from 511 to 512, the file will
read normally.
8.1.1.3 Reading Images from Macintoshes
Files imported from Macintosh via Mac-TCP are corrupted by the
addition of an extra header. This often creates the impression
that PC-based programs are incapable of reading Macintosh images.
TN-Image, however, automatically detects the presence of the header
and eliminates it before reading any image.
8.1.1.4 Reading Raw ASCII images
Raw ASCII images consisting of a series of integers are readable
by TN-Image. To read an image in ASCII format, you must select
"Raw ASCII" as the File Type in the Load Menu. Then set the
remaining parameters the same way as for "Raw Bytes" (Sec. 8.1.1.1).
Some of the options (such as bit packing) do not apply to ASCII files
and their setting is ignored.
8.1.2 Save image
Transfers an image or selected portion of the screen to a disk file.
File format
Format in which to save the image. See "Custom format" below
for details on creating files in your own customized format).
Save entire image/selected region -
If "entire image" is selected, the currently-selected image will
be saved in its entirety. Otherwise, only the currently-selected
screen region (which can beyond an image or contain 2 or more
images) will be saved. The actual size of the region saved is
displayed after the file is written.
Bits/pixel -
You can select standard values of 1,8,15,16,24, or 32
bits/pixel, or select "other" to specify any other value
between 1 and 32. The resulting file size is proportional to
the bits/pixel. This can result in a considerable savings in
disk space. Monochrome (1 bit/pixel) is ideal for line drawings
and graphs. Don't forget that saving an image in a lower
bits/pixel than it was created causes a loss in color accuracy.
For example, if you save an 8-bit image as a 3 bit/pixel image
file, the colors in the image will look slightly different from
the original colors when you load it back. If you save it as a
monochrome (1 bit/pixel) image, all pixels above 50% of the
maximum color will come out white and those below 50% of
maximum will come out black.
NOTE - Some file formats (e.g., GIF and PCX) only allow certain
values for bits/pixel and number of colors. TN-Image displays
an error message if an illegal value is selected.
WARNING - Due to limitations in the capabilities of some
other programs, saving images using "non-standard" bits/pixel
or using "non-standard" numbers of colors can result in image
files that are not readable by some other image viewers. For
example, one well-known shareware file interconversion program
can only handle 4,8, and 24 bit/pixel TIF images, but not the
common 15 and 16 bit images. One commercial Macintosh program
can only handle 8,15,24, or 32 bit/pixel images, but not 16
bits/pixel. Very few other programs can handle odd values such
as 12 bits/pixel. However, these values can be extremely useful
and widely used in handling radiological, electron microscope,
or MRI images, which are often of unusual pixel depths.
TN-Image will display an appropriate warning if you select a
"non-standard" file format.
Treat data as Color / Gray scale -
When saving images greater than 8 bits per pixel as TIF or
Custom files, it is sometimes useful to save the image as if the
image data represent shades of gray instead of colors. Selecting
"gray scale" causes TN-Image to treat the image as if each pixel
value was already a "luminosity", and skips the conversion from
RGB to luminosity. This setting is ignored if the image is saved
as 8 or less bits/pixel, or if it is saved as a color image (by
selecting "2" or "3" as the number of primary colors). Normally,
this setting should be kept on "Color".
Filename -
The file name under which the image will be saved (can include
drive and path). The previous 20 filenames are kept on a stack
and can be selected with the up and down arrow keys.
Image no. -
Indicates the currently-selected image which will be saved if
you have selected "save entire image". Has no effect if you are
saving a "selected region". This option is mainly for
informative purposes and does not normally need to be changed.
Extra TIF Param.(for `Other') -
If you select "Other", it is also possible to customize several
additional parameters. Currently, these values only have an effect
for TIF and "custom" file formats.
No.of primary colors(1-4) -
If you select "1", the image will be converted to grayscale
("luminosity") before saving, and the red, green, blue, and
black bits/pixel specified below are ignored. If you select
more than 1 color, the number of bits for each color, when
added together, must equal the total number of bits/pixel you
specified under "other bits/pixel". If they don't, TN-Image
displays a message to that effect.
Red bits/pixel No.of bits of red to save.
Green bits/pixel No.of bits of green to save.
Blue bits/pixel No.of bits of blue to save.
Black bits/pixel No.of bits of black to save (CMYK files only).
For example, to save only 4 bits each of the red and blue planes
of your image, set the following values:
`Other' bits/pixel (on left side of
dialog box) = 8
Number of primary colors = 2
Red bits/pixel = 4
Blue bits/pixel = 4
Green bits/pixel = 0
Black bits/pixel = 0
NOTE: TN-Image currently cannot display more than 8 bits/pixel
of each color (i.e., a total of 24 bits/pixel).
This is due mainly to limitations in the current
generation of PC video cards. Thus, there is no advantage in
setting the bits/pixel for any one color higher than "8".
You can only specify black bits/pixel if the "cmyk" option is
checked.
RGB->CMYK -
Convert the image from "RGB" to "CMYK" (cyan, magenta, yellow &
black) format when saving. (When reading a CMYK image, it is
automatically converted to RGB, since there cannot be a "CMYK
computer monitor"). If you are using a non-standard bits/pixel
mode, you also need to specify the number of red, blue, green,
and black bits/pixel (the values will be changed to the
corresponding c,m,y, and k values). If you select a
non-standard format, TN-Image will display a warning to that
effect. Selecting CMYK is only allowed for the 32 bit/ pixel
standard mode and the "Other" (non-standard) mode. If you try
to save an image with CMYK checked in any other mode, TN-Image
will display an error message. This is because the TIF
specification (as of version 6.0) does not recommend using
lower color depths for CMYK.
This option is useful for exporting the image to other programs
which cannot create their own CMYK images for printing.
JPEG quality factor -
An integer between 1 and 99. Values above 90 or below 10 are not
recommended. Smaller values result in greater compression and
more signal loss.
NOTE: Jpeg is a lossy file format. This means an image saved in
JPEG format will lose some information. Images consisting of text
and sharp lines are not good candidates for Jpeg compression,
because the compression algorithm is optimized for realistic
scenes such as images from photographs. Files should only be
saved in Jpeg format when all image processing has been completed,
and the smallest possible size is needed.
Also, some settings, such as red, green, blue, and black bits/
pixel, and CMYK conversion, are ignored for JPEG.
8.1.3 Printing images
Prints the image or selected portion of the screen on a laser printer.
A laser or inkjet printer that uses a page control language similar
to Hewlett-Packard's PCL3 or PCL5, or any PostScript printer
supporting PostScript Level 2 or above is required. (PostScript
Level 2 is not to be confused with "PostScript Type 2 fonts",
which don't exist).
8.1.3.1 Printing Black-and-White or gray scale images
Most laser printers are optimized to print text. This means the
pixels are printed by the printer as dark as possible and adjacent
pixels partially overlap. The effect that this has on graphics
printing is that the darkest 50% of the image will appear as
black. For example, if you are printing at 8x8 dithering mode (64
gray levels), shades 1-32 will appear white to black and shades
33-64 will all appear black. Thus, your gray-scale resolution is
effectively cut in half. Although you can make your image lighter
before printing or select a lighter setting from TN-Image, the only
way to avoid any loss of resolution is to set your printer to
print lighter. This is easy to do but varies from printer to
printer. See your printer manual for the procedure.
To select a lighter print intensity from TN-Image, select
`file...print' from the menu, then click on `printer color adjustment".
Adjust the red, green, or blue intensity factors as desired. 128 is
normal (dark) printing. Any other values will be multiplied by
the data going to the printer to make it lighter or darker.
If you are using a monochrome printer, be sure to select "B/W or
Grayscale". The red, green, and blue intensity factors will be
averaged for grayscale printing.
Currently, only laser and inkjet (bubble jet) printers are supported.
No support is planned for dot-matrix printers, because the
image quality would be unacceptably low.
Print quality can often be improved by using glossy paper sold for
pen plotters instead of regular paper.
----Column 1---
Vertical/Horizontal - Selects whether image will be printed
in "portrait" (vertical) or "landscape"
(horizontal) mode.
Positive/Negative - Print normally (white on the screen =
white on the paper) or as a negative.
Print entire image/ print selected area
- Select whether to print the entire
currently-selected image, or the
currently-selected screen area which
may span 2 or more images.
----Column 2---
No. of copies - Number of copies of the image to print.
Not all printers accept this command.
Printer Device/file name - See Sec. 8.1.3.4
Color adjustment - Darkness of printed image (255=darkest).
The red, green, and blue factors are averaged
when "printing type" is "B/W".
Vert. position (inches)- Offsets the image by the specified no. of
inches down the page.
Horiz.position (inches)- Offsets the image by the specified no. of
inches to the right across the page.
Media type - Optimizes the output for the type of
paper being used.
The following table shows the differences
used for different media types:
Media Print No. of Recommended
Type Quality passes* Depletion*
----- ------- ------- -----------
Plain Draft 1 --
Normal 2 25% w/gamma
Presentation 4 50% w/gamma
Bond Draft 1 --
Normal 2 25% w/gamma
Presentation 4 50% w/gamma
Premium Draft 1 --
Normal 2 25% w/gamma
Presentation 4 50% w/gamma
Glossy Draft 2 25%
Normal 4 25%
Presentation 4 0%
Transpar- Draft 2 25%
ency Normal 4 25%
Presentation 4 0%
On certain printers, e.g., H/P 540, the
number of passes and the depletion are
determined automatically by the printer
and may differ from the value in the table.
On some other printers, depletion and no.
of passes cannot be changed, and setting
them to different values has no effect.
* Recommended by H/P.
For PCL printers, such as the HP LaserJet and most inkjet printers,
the following options also apply:
Resolution - Selects the desired dots/inch resolution
to print the image. Normally this is
set to the highest value your printer
can handle (see discussion above).
Typical values are:
150 dpi 300 dpi
600 dpi 1200 dpi
This number must be set _exactly_.
For example, a 300 dpi printer may ignore
the setting, or it may print nothing at all
if the resolution is set at 299 or 301.
The resolution is also used to estimate the
default size for PostScript output.
Dither size - Determines the number of separate gray or
color levels that can be printed:
dithering
size no.of gray/color levels
---------- -----------------------
1x1 2
2x2 4
4x4 16
8x8 64
16x16 256
The size of the printed image also increases
proportionately with the dithering size.
No "error propagation" is performed, in order
to maximize resolution for text.
Print Quality
Draft
Normal
Presentation
- Selects the quality of printout. Presentation
quality takes longer, but gives slightly
better results.
Not all printers support this option.
Depletion - - Improves image quality by removing a
Printer Default certain percentage of the pixels. It is
None (0%) recommended to leave this setting at
25% "printer default" unless unsatisfactory
50% results are obtained.
25% + gamma corr. The highest two settings also apply
50% + gamma corr. gamma correction to the printed image, if
this feature is supported by your printer.
Gamma correction produces a smoother
transition from one color to the next.
See the table above for recommended
depletion levels.
Not all printers support this option.
Printer gray balance - If checked, the internal gray balance
adjustment in the printer will be activated
if present. This is supposed to adjust the
colors so that blacks appear black instead
of dark green. Do not check this box if
you have changed any of the values under
"Printer color adjustment" (see above),
since this would result in correcting the
gray balance twice. If your printer does
not support this option, checking this
will have no effect.
For PostScript printers, the following options apply:
Horizontal image size (inches)
Vertical image size (inches)
- The output will be scaled accordingly to
shrink or enlarge the image to the specified
size. The default values are calculated on
the basis of the DPI value entered under
"Printer resolution".
Rotation (Degrees) - The printout will be rotated
counterclockwise by the specified angle.
The angle is centered at the lower left
corner of the paper. Note that a rotation
may cause part of the image to be off the
page unless 'horizontal position' is also
adjusted.
Interpolate - If checked, and if the output resolution
of the printer is high enough, additional
pixels will be added to smooth the output.
NOTE: PostScript Level 2 or above is required.
8.1.3.2 Color printing
Color printing uses the same parameters as B/W printing, except
you must select RGB, CMY, or CMYK color instead of grayscale.
Color printing can take a much longer time than B/W printing,
and requires more printer memory on a laser printer. Use B/W mode
whenever possible. The choice between the color types is subjective;
however, CMYK generally gives darker blacks.
NOTE: You do not have to convert your image to CMYK format to
print it in CMYK mode.
Printing type - - Selects color printing mode.
B/W (grayscale) - Recommended for non-color printers and
for monochrome images. The pixel values
are sent to the printer without
filtering them through the color
palette. Thus, if you made the image
lighter or darker by dragging the
palette, these changes will not be
reflected in the printout.
RGB /indexed color - Not recommended for PCL inkjet printers,
because some PCL printers insist on
interpreting this command to mean that
all pixels not explicitly defined are
to be printed as "black". This causes
a wide black stripe to be printed next
to the image, and causes printing to
take a much longer time.
For PostScript printers, this is a
good setting to use for both grayscale
and 8-bit color images.
If the image is 8 bits, the colors
or gray levels are determined by the
palette. If it is a true-color image,
the RGB values are used directly.
Prints using red, green, and blue inks
if available (not supported by all
printers).
CMY color - Recommended selection for PCL color
printers.
Not recommended for black & white printers.
CMYK color - For color printers - gives darker blacks
but takes 33% longer.
Printer color adjustment - Adjusts each color to allow you to match
the printer output with the screen. For
each color, a value of 128 (the default)
is "normal". Increasing the value will
increase the intensity of that color.
If CMY or CMYK is selected, the cyan,
magenta, and yellow inks are changed.
If RGB is selected, the red, green, and
blue inks are changed.
If B/W-grayscale is selected, the black
value is taken as the average of the
three color values.
NOTE: For CMYK printing, it is important
to keep the 3 colors balanced so that
the average is 128. Otherwise, the black
ink, whose value is derived from the 3
pigments, will also become lighter or
darker.
8.1.3.3 Printing under Unix
If you have multiple users on your system, or if you do not have
write permission for the printer, it is recommended to change this
to a regular file, e.g., "temp.print" and print the file later using
lpr.
Warning: if a device is specified that is not a printer or a
file, bad things will happen.
8.1.3.4 Printing to a file or another printer
TN-Image does not yet have the capability of printing over a
network. Therefore, for networked printers, it is necessary to
create a 'print file' and send the print file to the printer
using other software. This can be done by entering a filename
instead of a printer name under "Printer device/file name" in
the "Print..." menu. This will create a print file which can be
sent to the printer later, such as at night when it is less busy.
In DOS, printing of a file can be done using the command:
copy /b print.tmp lpt1
However, copy /b does not work correctly on some printers. In this
case, you can use 'tnprint.exe', which is a replacement for DOS's
'print.exe'. This program is available at the ftp site.
In Unix, printing of a file is done using the command:
lpr -Pmyprinter print.tmp
To schedule the printing at a specific time, use a program such as
TNSHELL in DOS, or 'cron' or 'at' in Unix.
If a printer device is entered, the image will be printed on that
device. "Printer device" refers to the printer name as it is known
to the operating system, for example:
DOS version: lpt1 lpt2 prn
Unix version: /dev/lp0 /dev/lp1 /dev/lp2 /dev/printer, etc.
8.1.4 Change Title
Changes the name of the image. This must be a valid filename.
If the title contains illegal characters (such as spaces or
control characters in the DOS version), they are automatically
removed and an error message is displayed.
8.1.5 Save Scan Data
Saves the data from the most recent strip densitometry scan
in a disk file. You are prompted for the filename. Do
not confuse this with "save image" - This will not save
a "scanned image"!
8.1.6 Create/Resize Image
You can create a new image by clicking and dragging with the mouse,
setting a fixed size and position, copying another image, or
resizing another image.
For 'fixed size', you must enter the x and y size (in pixels), and
the x and y position for the upper left corner of the image. The
screen contents at the specified location will be copied into the
new image.
For 'use mouse', use the mouse to select the region for the new image.
The screen contents at that location will be copied into the new
image. The other parameters will be ignored.
For 'copy another image', enter the image number of the image to
duplicate and the x and y position for the upper left corner of the
new image.
For 'resize another image', enter the image number of the image to
duplicate, the new x and y size (in pixels), and the x and y position
for the upper left corner of the new image. Any space beyond the
copied image will be set to black.
8.1.7 Switch to
Make some other image the currently-selected, foreground image.
This option has been replaced by "About the program...", which
can also switch images.
8.1.8 Create file format
Defines a new image file format. This allows you to add up to 100
new formats to TN-Image, or create your own customized format.
Once defined, the new format is automatically recognized by
TN-Image and can be loaded and saved without any special action
on your part.
If you know certain basic details about the image format,
or have a sample image file already in that format, you can easily
create an image file in almost any file format imaginable, which
will be readable by any Intel-based PC, Macintosh, IBM mainframe,
and many UNIX systems.
Custom formats are particularly useful if reading medical images
from an X-ray scanner, which vary from one manufacturer to the other.
Currently, only uncompressed custom formats are available.
Of course, with this much flexibility it is impossible to test
every possible combination of parameters on every destination platform,
so you should always make a test image before proceeding to make
sure the file is readable on your non-PC system.
*IMPORTANT*
Always test to make sure your custom file is readable on the target
system before erasing the original!
The information you need to know is:
(1) Bits/pixel that the destination system expects. This can be
calculated from the number of colors on the screen, using the formula
No. of colors = 2 ^ (Bits/pixel).
Thus, if there are only 2 colors (black and white), there is 1 bit
per pixel.
(2) Destination system - If the destination computer is not a
PC, Mac, or IBM mainframe, pick whichever seems closest. Many UNIX
systems use "big-endian"-type processors similar to the Mac. VMS
systems use "little-endian" processors similar to the PC.
(3) Size of the image file header. To get this information, you
can either guess, or view your sample image with a hex editor.
Often it is a power of 2 (32, 128, etc).
(4) Offset of the x and y size - This is the most difficult step
if you are unfamiliar with hex notation. If you can't make a guess,
if you are a registered user you can send us a copy of your sample
image and we will determine these numbers for you.
(5) The no. of primary colors (1 for grayscale or 3 for color).
Example 1: Creating a file format for images from a Lumisys X-ray
scanner. No sample image file is needed.
1. Select "File...Create file format".
2. Set the following settings in the dialog box:
Target platform - Mac
Bit packing - None
Format Identification- By Extension
Extension - LUM
Identifier - (none)(leave blank)
Bytes to skip - 2048
Use header - (not checked)
Header file - (none)(leave blank)
Header bytes - 0
Default bits/pixel - 16
Default No.of colors - 1
3. Set the following file offsets:
x size - 806
y size - 808
Bits/pixel - 810
All others - -1
Care must be taken not to allow the offsets (which take 2 bytes
each) to overlap with each other or with your identifier. The
identifier itself cannot exceed 40 characters. If an identifier
is specified, the image file must contain it at the specified
offset. If an identifier is not specified, the image file must
have the specified 3-letter file extension ("LUM" in this case).
"Bytes to skip" must be a multiple of 2 in this case, because
there are 2 bytes (16 bits) per pixel. If you skip an odd number
of bytes, the image will look strange because the light and dark
areas are partially reversed.
Similarly, if the wrong target platform is selected, the image
could look posterized or grainy, because the bytes are being put
into the wrong pixels. It is sometimes necessary to experiment
if you have an unknown image format.
4. Then click on "OK". The new file format has been created.
5. Reading and creating images in the new format will now be
transparent. The format descriptor file "FORMATS" can be used on
the shareware version of TN-Image. The shareware version cannot,
however, create files in the new format or create new formats.
Example 2: Creating an IMDS file. IMDS is a little-known and rarely
used monochrome format similar to GEM's IMG format, except that IMDS
was used on IBM mainframes running MVS, and there seems to be no
documentation for it.
1. Select "File...Create file format".
2. Set the following settings in the dialog box:
Target platform - MVS
Bit packing - TIF-like
Format Identification- By Extension
Extension - IMG
Identifier - (none)
Bytes to skip - 0
Use header - ˚ (checked)
Header file - <Name of a sample IMDS file>
Header bytes - 32
Default bits/pixel - 1
Default No.of colors - 1
3. Set the following file offsets:
x size - 12
y size - 14
All others - -1
4. Then click on "OK". The new file format has been created.
5. Click on an image, or select something on the screen, and
save it in the new IMG format (by clicking on "Format" then
the last "IMG" item. Your sample IMDS file must always be
present to create image files in this format.
6. Test to make sure the image is readable. Since TN-Image
can already read this format, simply select "File...Read"
and press <Enter>. If you set the above settings correctly,
the image should appear as a black-and-white version of
your original.
The default bits/pixel and default no.of colors are needed only if
the these values are not in the header.
Example 3: Define a file format for raw byte images.
1. Select "File...Create file format".
2. Set the following settings in the dialog box:
Extension - RAW
Target platform - PC
Bit packing - None
Format Identification- By Extension
Identifier - (none)
Bytes to skip - 0
Use header - (unchecked)
Header file - (none)
Header bytes - 0
Default bits/pixel - 8
Default No.of colors - 1
Default x size - 382 (substitute actual size)
Default y size - 362 (substitute actual size)
Default red bpp - 0
Default green bpp - 0
Default blue bpp - 0
Default black bpp - 0
3. Check the file offsets to make sure they are all -1.
4. Then click on "OK". The new file format has been created.
Because "by extension" was specified, the raw image must have
the extension .RAW to be identified.
8.1.9 Save FFT
Saves the currently-selected FFT matrix to disk in ASCII format.
This allows you to precisely change any desired frequencies,
then reload the FFT and reverse-transform.
Warning: These files can be quite large.
8.1.10 Erase FFT
Erases the matrix used in storing the FFT, if a Fourier transform
has been performed on the image, thus freeing up a considerable
amount of memory. It will not erase the Fourier transformed image
that appears on the screen. If no FFT's have been performed, this
has no effect.
8.1.11 Unload image
Removes the currently-selected image from the screen and frees up its
memory. Also erases the image's backup and its FFT if present.
If your image is large, and there are other images above it in RAM,
on rare occasions it may not be possible to free the memory right
away. In this case, it is occasionally necessary to select "unload
image" a second time.
8.1.12 DOS Command
Shell to DOS to execute a command or run a different program. Or,
to obtain a DOS command line, enter "Command". Type "Exit" to
return to TN-Image. DOS requires a small amount of memory below
1 megabyte to exit commands. Thus you could get an "insufficient
memory" error even if there is a lot of high memory.
This function is, of course, not available in the Unix version.
8.1.13 Quit
Return to operating system. If any images have been modified, you
are given an opportunity to save them. Alt-X also can be used to quit.
8.1.14 Load FFT
Reads a Fourier-transformed image stored in ASCII format.
The file format is as follows:
FFT of <image name>
xsize <x size in pixels>
ysize <y size in pixels>
Real
<Real frequencies from row 1>
...
<Real frequencies from row n>
Imaginary
<Imag frequencies from row 1>
...
<Imag frequencies from row n>
This format differs from the format used in TN-Image prior to
version 2.18. The header in these earlier files must be changed
before they can be loaded.
8.2.0 Image menu
8.2.1 Delete region
Erase part or all of an image or background. After selecting `delete
region', move to one corner of the region to erase, and click and
drag to the other corner. This rectangular region will be set to
the background color. (If there is another image behind the topmost
image, the obscured part will be unaffected.)
8.2.2 Crop
Similar to `delete region', except erases everything except the
currently-selected region, including the background and any
portions of any image currently visible on the screen. If an
image is obscured by another image, the obscured part is not
cropped.
8.2.3 Erase background
Removes everything on the screen that is not a part of an
image, and sets it to the background color.
8.2.4 Move
Move part of an image or drawing to another region.
After selecting `move', click and drag to select the region to move.
The region is cut and pasted in the new location as soon as you
release the mouse button. If the pasted portion falls partly on an
image and partly on the background, the portion that falls
on the image sticks to the image and the part that falls on the
background sticks to the background.
You can change the mode of interaction of the moved region with the
background or other images by changing the "Pixel interaction mode"
from the "Config" menu. For example, if the pixel interaction
mode is "subtract" the moved region will be subtracted from
whatever is there. (See "Pixel interaction mode" below).
8.2.5 Copy
Copy part of an image or drawing to another region.
After selecting `copy', click and drag to select the region to move.
The region is copied and pasted in the new location as soon as you
release the mouse button. If the pasted portion falls partly on an
image and partly on the background, the portion that falls
on the image sticks to the image and the part that falls on the
background sticks to the background.
You can change the mode of interaction of the copied region with the
background or other images by changing the "Pixel interaction mode"
from the "Config" menu. For example, if the pixel interaction
mode is "subtract" the copied region will be subtracted from
whatever is there. (See "Pixel interaction mode" below).
8.2.6 Change size
Creates a new image of a different size than the currently-selected
image. You can specify different size factors for the x and y
dimensions. However, both x and y factors must be either greater
than or less than 1.0. For example, setting the x factor to 1.1 and
y factor to 4.78 creates a vertically elongated image.
If the image does not contain fine detail, it is often
convenient to shrink the image to x and y sizes of 0.5 or less
before saving it. Setting the x and y factors to 0.5 decreases
the file size by 75%. Conversely, enlarging the image allows
you to fine-tune each pixel value before shrinking it back to
normal size. (Note that in this case, you will have 3 images in
memory: the original, the enlarged image, and the new shrunken
modified image. It is recommended to delete the enlarged images
as soon as they are not needed, to avoid running out of
memory.)
8.2.7 Rotate image
Creates a new image identical to the currently-selected image,
except that it is rotated by 90¯.
8.2.8 Flip horizontally
Converts the currently-selected image or region into a
left-right mirror image of itself.
8.2.9 Flip vertically
Turns the currently-selected image upside-down.
8.2.10 Backup
Creates a backup copy of the current image in memory. This is
recommended before manipulating the image or adding text, in
case you don't like the results. Selecting "Restore" will retrieve
the screen back onto the screen.
8.2.11 Restore
Replaces the current image with the backed-up copy if one exists.
8.3.0 Process menu
8.3.1 Filter
Modifies the currently-selected image, or the selected screen
region, without creating a new image. The original image
should be backed up before filtering it, in case you don't
like the results. The amount of filtering is adjustable from 1
to 10 (maximum).
8.3.1.1 High-pass filter (Sharpening)
Extracts only the highest spatial frequencies in the image.
More low frequency components are saved if a larger 'kernel' is
selected. If the image contains few high-frequency components,
and you selected too much sharpening, the result may appear
dark or black. You can compensate for this by increasing the
contrast of the image after filtering it.
8.3.1.2 Low-pass filtering
Low-pass filtering eliminates sharp edges from the image,
causing a blurring effect. The total intensity is unchanged,
but is spread throughout the neighboring pixels.
8.3.1.3 Background subtract
This is similar to high-pass filtering except it removes only
the lowest frequencies. This has the effect of removing uneven
background in the image. As with high-pass filtering, it can
make the image appear darker. Selecting a larger kernel removes
less of the low frequencies, but will require much more processing
time. A preferred method is to use the "kernel multiplier".
Selecting a multiplier of 5 with a 3x3 kernel produces results
similar to using a multiplier of 1 with a 15x15 kernel, but is
many times faster. For this reason, it is recommended to set
the kernel to 3x3 for background subtract.
You can specify whether "black" or "white" pixels should be
considered as the background. If you select "white", the image
will generally get lighter in regions of unvarying pixel intensity.
If the background value is "black", the image will get darker
wherever the pixel intensity does not vary. You can compensate
for this by increasing the contrast.
Background subtraction will also trash any text in the image.
See "Background flatten" below for an alternative (and faster) way
to remove background gradients.
8.3.1.4 Background Flatten (de-trending)
This filter removes large-scale gradients from the image or
selected region by measuring the average pixel value in each
corner and then adding or subtracting a value to equalize the
overall intensity. This could also be done manually, by creating
a gradient region on the screen and adding the image to it (see
"Gradient fill"). However, the manual method is not 2-dimensional.
In contrast to Background Subtraction, this filter does not trash
text.
8.3.1.5 Noise filtering (median filtering)
Median filtering removes extraneous pixels from the image.
This is useful if the image contains noise which consists
of little dots that are clearly outside the range of the other
pixels. If a given pixel varies by more than a certain amount
from the pixels around it, median filtering substitutes the
median of the neighboring pixels, thereby eliminating noise from
the image. The image is otherwise unaffected. The range in Ò pixel
value units, outside of which a value is to be considered noise,
can be changed. A higher value results in less noise removal.
Excessive noise filtering can make an image appear posterized.
A setting of 0 will create a smoothing effect.
8.3.1.6 Laplace edge enhancement
This filter finds any edges in the image whose length is equal
or greater than the kernel size. The edges are then increased
in intensity while non-edge regions are eliminated. The effect
on text is to create an outline of the text.
8.3.1.7 Sobel edge enhancement
This filter is similar to Laplace edge enhancement except that
the effects are gentler. A Sobel filter enhances the color or
intensity gradient, so that areas of constant color become black.
8.3.1.8 Edge detection and edge sharpening
Edge detect ≥ Detects and enhances edges in the image,
Edge detect ƒ preferentially in the horizontal or
vertical direction.
Sharpen ≥
Sharpen / Sharpens the selected region or image
Sharpen ƒ preferentially in the indicated direction,
Sharpen \ creating a `freeze-fracture' 3-D effect.
This is particularly useful for images
of biological specimens that have low
contrast, since it highlights the overall
shape of the cells.
8.3.1.9 Adjustable parameters
Kernel
The kernel is the number of pixels used in calculating a pixel
in the new image. The processing time needed increases with the
square of the kernel size.
Kernel multiply factor
A "kernel multiply factor" allows you to select an arbitrarily
large convolution kernel without an increase in computation time.
This is possible because usually only a small sample of the
surrounding pixels are really needed to calculate the new pixel
value. For most types of filters, a 3x3 kernel with a kernel
multipier of 3 gives the same results as a 9x9 kernel, but is 3
times faster. For sharpening and blurring, this doesn't work,
and the factor is automatically set to 1.
Amount of filtering
The amount of filtering applied to the image, from 1 (minimal
filtering) to 10 (maximal filtering).
Range (median filter)
For median filters, you can specify a range of pixel values
outside of which the pixel will be considered to be a noise
pixel. For instance, if the median value of all the pixels in
a given area is 123, and the range is set to Ò10, then the
pixel will be replaced with the median value (123) only if its
value higher than 133 or less than 113.
8.3.2 Warp
Corrects distortion in the image. Currently works in vertical
direction only.
(1) Select a series of control points to define the distortion
to be corrected. For example, if you have an SDS gel in
which the bands are U-shaped, trace out a U-shaped curve
somewhere on the image that follows the U shape.
(2) Press any key. This fixes the curve in place (it becomes
invisible).
(3) With the mouse, select a y-value somewhere below the lowest
point in the curve which you traced out.
(4) Click the left mouse button at the desired y-value.
(5) Each vertical line on the screen will be shifted up or down so
that each point on the curve you traced out is lined up with the
selected y-value.
Future versions of TN-Image will have a more elaborate, 2-dimensional
distortion-removal feature. Contact the author for availability
dates.
8.3.3 Measure...
8.3.3.1 Distance measurement
Measure distance between two points. Click the left mouse button,
move to the end point, and release the mouse. Click on the top
menu bar or press <ESC> when finished.
Before making distance measurements, you can calibrate your image
as described in Sec.8.3.9, using "2D linear calibration" mode.
This will cause the results to be in known units (such as
centimeters) rather than pixels.
If the image has been calibrated in a "1D" mode, distance measure-
ments are reported as uncalibrated pixel distances.
8.3.3.2 Angle measurement
Measure the angle between 2 lines. Same as distance measurement
except you must click and drag twice. The angle is always given
as the most acute of the two angles between the two lines.
8.3.4 Calibrate
Calibrates the image or screen x and y coordinates. To calibrate
an image, select "New calibration" from the menu, then click on the
known calibration points in your image and enter the calibration
values. The calibration points (which appear as small squares) can
be dragged to new locations if desired. When finished, press any key.
A dialog box will appear; select "linear" or "logarithmic"
calibration, and change the title if desired. A small window will
appear displaying the calibrated value for the current mouse position.
The calibration does not have to be vertical or horizontal, but can
be in any direction on the screen.
To end calibration mode, select "Calibrate" again and select
"Hide calibration". To restore the previous calibrations, select
"Unhide calibration".
Calibrating an image affects distance measurements and strip
densitometry area calculations.
Each image, as well as the background, can be calibrated separately
and can have a different title.
Four types of calibration are possible:
(1) 1-D linear calibration: Measures the distance from a line
perpendicular to the best-fit line passing through your calibration
points. This calibration is useful for images of isoelectric
focusing gels, or other situations where the distance in one
direction is the parameter of interest.
(2) 1-D logarithmic calibration: Same as (1) except distances are
logarithmic (For example, if 10 pixels corresponds to 1 unit of
distance, 20 pixels would be 10 units, and 30 pixels would be
100 units). This calibration is suitable for acrylamide and
agarose gel electrophoresis images.
(3) 1-D 2nd-order polynomial calibration: Same as (1) except
distances are fitted to a quadratic equation. Not really very
useful, but it was easy to program.
(4) 2-D linear calibration: Distances are calculated as the distance
from the point (0,0). This calibration type is suitable for
calibrating to objects of known size on the image (Sec. 8.3.4),
for example if a ruler was included in the image.
EXAMPLE: To calibrate an SDS-PAGE gel for molecular weight standards:
(1) Select "New calibration".
(2) Click on "OK" to start calibration.
(4) Click on each size standard in the image, then enter the
corresponding molecular weight. Each point will be shown by a
small box. If you make a mistake, you can go back and drag
any of the boxes to a new location. A best-fit line is
automatically drawn connecting the boxes. Make sure that this
line is in the same orientation as the lanes in your gel
(i.e., vertical or near vertical if your lanes are straight).
(5) When finished, press a key. The boxes and line will disappear.
(6) Select "logarithmic" calibration from the dialog box.
(7) Change title to "Molecular weight" (optional).
(8) The molecular weight is now displayed continuously. You can
move the display window to any location by clicking on its edge
and dragging to the new location.
Example 2:
Calibrating coordinates on the image to centimeters using a ruler
in the image:
(1) Select Process...Calibration...New Calibration.
(2) Click OK.
(3) Click on the ruler markings on the strip in your image.
A small box indicates the calibration point. Move the box by
clicking-and-dragging if necessary. After releasing the mouse
button, enter the centimeter value. Repeat for at least 2 more
calibration points. The program uses least squares calculations
to find the best calibration fit to your points.
(4) When finished, press <ESC>.
(5) Select "2D Linear" from the menu, change the title to
"Centimeters", and click OK.
(6) The image is now calibrated. Each image, as well as the back-
ground, can have a different calibration. The distance is
measured as the distance from 0,0 as defined by your
calibration points. You can now perform calibrated distance
measurements.
8.3.5 Spot Densitometry
Performs densitometric analysis on parts of the image.
See also "Strip densitometry".
For a tutorial, view the image DENSITOM.PCX.
In high-color and true color modes, the image is treated as a 15,
16,or 24-bit deep monochrome image during densitometry. This is
the traditional method of densitometric analysis (as opposed to
analyzing each color separately). NOTE: If a monochrome or 8-bit
image is converted to color, the original correspondence of pixel
values to optical density (if one existed), may be lost.
Pixel compensation - If checked, this will cause TN-Image to use
in its calculations the actual optical density value that
corresponds to each pixel, instead of the raw pixel value. This
information is often provided by digital scanners in the form
of a `gray response curve' that is embedded in the TIF file. It
is recommended that pixel compensation be checked (˚) for all
densitometry.
Pixel compensation is not applicable for color (15,16,24, or
32-bit/pixel) images.
Maximum signal - Selects whether pixel value corresponding to
`black' or `white' (0 or 255 in 8 bpp mode) is to be considered
the strongest signal. If you have an image of a protein gel,
for instance, the bands appear black and maximum signal should
be set to "black". For DNA gels, the bands appear white and
maximum signal should be set to "white".
NOTE: Selecting "Black" as the maximum signal will cause the
reported values to be calculated as 1 - (measured value). Thus,
if the average uncorrected pixel intensity of a spot is 0.25,
the density (with "pixel compensation" off) will be 0.75.
Area selection - Automatic: Automatically finds the boundary of
the region. Move to a point near the middle of the region to
be analyzed and click the left mouse button. TN-Image will
automatically determine the boundaries of the area to be
densitometrically measured. This boundary is defined by the
set of contiguous pixels whose value is between the maximum
value (which can be selected above as "black" or "white") and
the background value (which can be selected to any value). It
is important that there is no unbroken trail of pixels in
this range that extends out of the region of interest,
otherwise an area larger than desired may be selected. As
long as you continue clicking, new areas will be selected and
analyzed. To stop densitometric analysis, either click on the
right mouse button, or click somewhere on the menu bar at the
top of the screen. If the background is set inappropriately,
the quantitated region may be too small or too large. The
densitometric operation can be aborted by pressing the <ESC>
key.
Manual: In this mode, you must select (by clicking and dragging)
a rectangular region to be analyzed each time.
Fixed size: In this mode, you select (by clicking and dragging)
a rectangular region the first time. From then on, as long
as densitometry is active, when you click on a point, a
region of size and shape identical to the first region will
be analyzed. This region will be centered at the point where
you click.
After each analysis, a message box appears with the results.
This is : (1) The area (total number of pixels) analyzed; (2)
The total signal measured (either in total pixel values or total
O.D. units, depending on whether pixel compensation is active);
(3) The average signal, i.e., the quotient of (2)/(1); (4) The
corrected total signal - background. For most purposes, including
gel analysis, the number of interest is (2) or (4), because you
need to measure the total amount of absorbing (or fluorescing)
material in the entire band. For other purposes, you may be more
interested in the signal density or concentration per unit area
on the image. The area is of interest in photomicrographs.
Background - Select the pixel value which is to be considered
the `background level'. The background level is important in
automatic area selection as described above. The background
value can also be automatically subtracted from the results
if desired.
Calibration factor - If a value is entered here, the result is
multiplied by that number. This is useful in converting to
micrograms of protein, for example, on an image of an SDS gel.
Subtract background - If checked, the background value will be
automatically subtracted from each pixel during calculations.
NOTE: See the warning under "Contrast".
8.3.5.1 Area measurements
Making area measurements:
1. Before starting, obtain a histogram on the image to find the
desired background value for use with automatic spot detection
(select "Color...Histogram"). Alternatively Use "Draw...Sketch"
before starting, and completely encircle the objects to be
measured with a white line. Outlining the objects manually
will obviate the need to select an appropriate background value.
2. Select "Image...Spot densitometry". Leave all the settings at
their defaults except for the Background Value.
3. If you wish TN-Image to identify the spot automatically, set
the background value to the pixel value that corresponds to the
brightest pixel in the background. Otherwise, if you have outlined
the regions beforehand, set the background value to any large
number (for example, if you outlined the areas with white
(=255), set the background to 254).
4. Click on OK, then click again to dismiss the message box.
5. Click anywhere inside the object to measure. The area being
measured will temporarily be painted in black, then a list box
will appear displaying the area.
6. Click on the background (or the upper left corner of the list box)
to hide the list box. Then click on the next object to measure.
7. Press <Esc> when done.
8.3.6 Strip Densitometry
See also "Spot densitometry"
For a tutorial, view the image file DENSITO2.TIF.
Strip densitometry is not as exciting as it sounds. It is similar
to spot densitometry, but is easier to perform and interpret because
it is not necessary for TN-Image to find the edges of the object.
If the image has been calibrated, moving the cursor over the plot
area of the graph causes two different x-values are printed. The
upper x value is the data point number, and the lower x value is
the calibrated value for the center pixel of the line along which
the strip densitometry was performed. If the image has not been
calibrated, the two x values will be identical. Clicking-and-
dragging within the plot selects a portion of the graph for area
calculation. The selected area is highlighted in reverse color.
If the image has been calibrated, this area (printed at the lower
right of the graph) is also calculated from the calibrated values.
To obtain a densitometric tracing of a trapezoidal region, select
"Strip densitometry" from the "image" menu. Do not confuse this
option with obtaining a scan from a scanner, which would require
a hardware interface, which is not provided with TN-Image. The
options are:
Select coordinates - If `select coordinates' is checked, you must
select the region to scan each time.
Repeat prev. scan - If `repeat previous scan' is checked, the same
region as the last time will be
re-scanned without you having to select it.
This is useful if you modified the image in
some way, such as by filtering it, in order
to see the effects on scanning.
Maximum signal - select whether a "black" or "white" pixel is to
Black be regarded as the most intense value. Note:
White in 8 bit/pixel modes(monochrome/pseudocolor),
this will be affected by the optical density
table which is often included in TIF files,
if `pixel compensation' is set to `on'.
Most scanners set their optical density
table so that `0' is the maximum optical
density. (To find out whether your image
file has an O.D. table, select "Configure...
Show O.D. table".)
Pixel compensation - if set to `on', the optical density table in
On the image file is used to correct the pixel
Off values from a range of { 0,255 } to values
that are proportional to the actual optical
density of the original image. This table is
usually generated by a scanner and is found
mainly in TIF files.
It is recommended to set pixel compensation to
`on' when analyzing images from a scanner.
This setting is automatically turned "off" in
the color modes, because these modes have
enough dynamic range that a gray scale table
is not needed.
Scan type - This option determines what type of region you
Snap to 90¯ can select for scanning. Selecting `snap to
Permit diagonal scan 90¯' causes the starting and ending edges of
Fixed width=1 the scan to "snap" to either vertical or
horizontal, whichever is closest. This is
fastest because it does not require any of the
anti-aliasing calculations which are needed
when you scan diagonally. However, if your
image contains objects that are oriented
diagonally, some resolution would be lost in
the scan because the objects will be scanned
at an angle to their true orientation.
The first two points always determine the
orientation of scanning. Scanning is always
done along a line parallel to these 2 points.
The 3rd and 4th points determine the direction
and shape of the region to scan. The area
being scanned is indicated by a sweeping
wave of temporarily inverted pixels.
Selecting `permit diagonal scan' allows you
to select any trapezoidal area with no re-
strictions on the starting angle. However,
the angle of the far side of the trapezoid is
always adjusted to make it parallel to the
starting side. This avoids confusion that
would otherwise be caused by having a small
`tail' at the end if the starting and ending
sides were not parallel.
Because of the grid nature of the screen,
this option is slower because it is
necessary to correct for `aliasing' caused
by pixels being at unpredictable distances
from the starting point. However, you can
scan objects that are oriented in any direc-
tion. To compensate for the slower speed,
the pixels are no longer inverted as they
were in earlier versions of TN-Image.
'Fixed width' only requires that you select
the two end points instead of 4. Densitometry
is performed in a rectangular region between
the two points using the specified width in
pixels (which can be 0 to 200). If the region
is not perfectly vertical or horizontal, anti-
aliasing is performed.
This method is the most useful for obtaining
results which need to be compared to each
other, or when the density of a very narrow
region (such as a line) is desired. Of course,
a narrower region will tend to be noisier
than a wide one.
'Fixed width' densitometry is slower than
the other two methods because more floating
point calculations and memory accesses are
needed. However, it may be more accurate.
ƒƒƒƒOptionsƒƒƒƒ
Automatically save scan
- If this option is checked, each scan will
automatically be saved in an ASCII file.
Filename for scan - A default filename of "1.scn" is provided.
If the 1st 8 characters of the filename
consist entirely of digits, the program will
automatically increment the filename after
each scan (For example, if the starting
filename was " 1000.dat", subsequent scans
would be saved under 1001.dat, 1002.dat,
etc.). If the filename contains letters,
the filename must be typed in each time.
You can also save the most recent scan at
anytime by selecting "save scan" from the
"File" menu.
Plot results - If checked, the scan results will
automatically be plotted on the screen
after each scan. Clicking the "OK" button
on the graph makes the graph disappear and
returns you to scanning mode. The graph is
always automatically scaled in the Y
direction to fill the entire box. When the
graph is visible, the data can be saved to
disk, a background curve can be subtracted
from the data, or the graph can be captured
into a new image (See "Plotting densitometry
results and other data").
Pause to show region- If checked, the program pauses after drawing
the 4 boxes, allowing you to verify that you
selected the correct region. Press a key to
continue.
Procedure:
1. Select "Image...Strip densitometry" from the menu.
2. Click on "Maximum signal=black" or "Maximum signal=white" depending
on whether the features of interest are darker or lighter than
the background.
3. Click on "Snap to 90¯" , "Diagonal scan", or "Fixed width"
(see above). If you select "Fixed width", enter the desired width
in pixels.
4. Click on "OK", then click anywhere to start.
5a. Click once on each corner of the rectangular area to be scanned,
in a clockwise direction, so that 4 boxes appear on the screen.
The region will be scanned from the first 2 to the last 2 boxes.
5b. For 'Fixed-width' densitometry, click at the center of the starting
and ending points, so that 2 boxes appear on the screen.
6. If any of the boxes are in the wrong position, or the lines
connecting them are crossed, click and drag the boxes to the
correct position. (NOTE: if the lines are crossed, the algorithm
automatically swaps the coordinates to un-cross them).
7. Press any key, or click anywhere to start scanning. The scan
results will be automatically plotted if "plot results" is checked.
The densitometry scan can be saved to disk or captured into a
new image from the plot window.
8. Click on "Save to disk" to save the densitometry tracing in an
ASCII file.
9. Click on "OK" to scan the next region, or press <ESC> or click
the right mouse button to stop.
NOTE: See the warning under "Contrast".
8.3.7 Plotting densitometry results and other data
There are several useful options available
in the plot mode:
Save to Disk
------------
Saves the currently-displayed graph into an ASCII file.
Smooth
------
Performs Gaussian smoothing on the data being displayed.
Auto Baseline
-------------
Automatically calculates an optimal curved baseline and
subtracts it from the data. The smoothness of the calculated
baseline can be changed by clicking on "BL smoothness". The
calculated baseline is displayed for 1 second before
subtracting it.
Manual Baseline
---------------
Allows you to select a baseline manually. Click at several
locations on the graph where you want the baseline to go. Small
squares will appear to indicate where you clicked. You can
click-and-drag these squares to move them. When finished, press
a key to subtract the baseline. The baseline curve is constructed
using a B-spline (see `B-spline curve'). The squares can be anywhere
on the screen, and do not have to be inside the plot. Also, you can
subtract a baseline from only a portion of the data by placing boxes
only under the portion you wish to change. However, any negative
numbers created by baseline subtraction are truncated to 0's.
Up to 200 boxes (`control points') can be used.
Capture Image
-------------
Clicking `capture' allows you to capture all or part of the
graph into a new image. After clicking on `capture', use the
mouse to select the desired portion of the graph. A new image
which includes that region is then automatically created. The
new image is put into the background, behind the image you are
currently scanning, so that you can continue with the next
scan.
Help
----
Calls a help screen.
OK
--
Ends plotting, returns you to densitometry mode.
8.3.8 Peak Areas
Finds the x and y coordinates of each peak and calculates the
peak area. The integration limits are shown as short black
lines on either side of each peak. No baseline subtraction is
carried out before calculating peak areas. Thus, best results
are usually obtained if you first subtract a baseline by
clicking on `Auto.baseline' or `Manual baseline'.
When the list of peaks is displayed, most of the click buttons
on the left side of the plot are still active, but now apply to the
peak list. This includes:
Save to disk
Capture image
Help
OK
The other buttons (`peak areas',`smooth', `manual baseline', and
`auto baseline') are inactivated while displaying the list.
You can also close the peak area list by clicking on the `-' symbol
in the upper left corner.
Area calculations: While the graph is displayed, you can also
manually measure peak areas by selecting the desired region
of the graph. To select a region, click with the left mouse
button and drag horizontally within the graph area. When the
mouse button is released, the total area of the selected region
is automatically displayed.
8.3.9 Trace curve
If you have an image of a graph, chromatogram, etc., TN-Image can
convert this into an ASCII file. Currently, TN-Image only traces
in 1 dimension, and from left to right. Contour tracings will be
implemented later.
Procedure:
1. First, clean up the image to remove any stray specks, labels, or
other points that could be confused with the graph. The entire
image must be clean, including the edges. The trace will jump
to the darkest y-value point for each x value, regardless of where
it is located on the image, even if it is not visible on the screen.
Use "Paint region" if necessary to eliminate white areas from the
image.
2. Select "Image...Trace curve".
3. If you want the trace to be saved automatically, check "Save trace".
4. If you check "Plot trace", the data will be displayed. You will then
be able to click on the "Save" button to save it. While the graph
is visible, you can smooth it, subtract a background, measure
areas, etc. (See "Plotting densitometry results").
5. If the image is a dark graph on a white background, click on "Color
to track= black". Otherwise, select "white".
6. Click on "OK", then move the mouse cursor to the left end of the
curve and click the left mouse button.
A cross-hair cursor indicates what is being traced out.
Click on "Cancel" when finished.
Sometimes, sharpening or thresholding the image can improve the
tracing. If there are extremely sharp peaks in the image, it may
be necessary to manually create a channel between the ascending and
descending parts of the peak to force the trace to follow to the
top. This can be done by selecting "Draw" from the menu, or pressing
<F2> (=manual draw), and carefully moving around with the cursor keys
(Be sure to back up your image before starting).
Checking "Debug" waits for a keypress after each x increment and
prints the x, y, and the pixel value being tracked. This is helpful
if stray noise pixels are accidentally getting included in the scan.
Only pixels on the selected image are included in the trace. Thus,
in order to trace something in the background, you must convert it
to an image first (use "File...Create/resize image"). Conversely,
if the image contains a white area (or black area, if "black" is
selected) that is is brighter than the area being traced, the cursor
will jump to this area instead of tracing your curve. If the
bright area is beyond the edge of the screen, the cursor will jump
to the edge of the screen. If this occurs, it will be necessary to
delete the offending area before tracing anything (The "backspace"
key is the most convenient way to do this).
8.3.10 Mathematical pixel operations (Math)
Although it is possible to add or multiply pixel values by any
factor by using the "brightness" or "contrast" menu items,
TN-Image also has a more powerful tool - mathematical pixel
operations.
Using the "math" menu, you can enter any mathematical formula
to transform each pixel value in one pass. This formula could
be any legal mathematical equation consisting of constants,
variables, and operators from the following list:
Constants - any real number (floating point or integer)
Variables - one of 4 pre-defined variables:
i = intensity (total pixel value)
r = red component of the pixel
g = green component of the pixel
b = blue component of the pixel
Operators - () = parentheses
^ = exponentiation
* = multiplication
/ = division
+ = addition
- = subtraction
For example, if you entered the following equations:
r=r+3
g=(r/4)+1.2345
b=g-b^2
each pixel would have its red component increased by 3, its
green component would be set equal to red/4 + 1.2345, and blue
would be set equal to green minus (blue squared).
To edit the equation, use the mouse or arrow keys to highlight
the desired row. Press <Enter> and edit the equation. Click on
<OK> or press <Enter> again when finished.
To perform "gamma correction" to your image, enter the following
equations:
r = r^1.8
g = g^1.8
b = b^1.8 ,
where 1.8 is the gamma correction factor. For monochrome, a higher
value (e.g., 2.35) is often used.
8.3.11 Transform (FFT)
Performs a Fast Fourier Transform on the image or selected
region. This can use a lot of memory because the frequencies are
stored as double-precision complex numbers, which require 16
bytes for each pixel. Thus, an FFT is 4 times as expensive as
a 32-bit image. Additionally, the mathematics of the FFT requires
that the image be first enlarged so that each dimension is the next
higher power of two. For example, if your image is 129 x 67 pixels,
TN-Image has to create a new buffer of 256 x 128 pixels (524,000
bytes) to carry out the calculations.
The FFT result is a matrix which is displayed as a new 128 bit/pixel
image. This new image can be saved, unloaded, annotated, filtered,
and manipulated like any other image. Any changes you make
to this image (such as adding text) are also converted to the
appropriate floating point numbers and inserted at the appropriate
position into the displayed component (real or imaginary) of the
FFT matrix. Therefore, changing pixels on the displayed image could
change the real component of the FFT, the imaginary component, or
both. After editing the image to enhance or eliminate specific
spatial frequencies, you can then perform a reverse FFT to obtain
the filtered result.
Forward/Reverse/Change display only
Selects whether to carry out a forward or reverse FFT, or to
merely change which component (original image, imaginary, real,
or power spectrum) is being displayed. No actual change is made
to the FFT data.
Real/Imaginary/Power spectrum
Selects whether to display the real, imaginary, or power spectrum
component of the transformed image, or only the original image.
NOTE: If you select "imaginary" or "power spectrum", the displayed
image will appear black if you perform a FFT followed by a reverse
FFT. This is because the original data do not have an imaginary
component. The original data are not lost!
Although a complete description of the many applications of
FFT's and deconvolution is beyond the scope of the manual, there
are a few TN-Image- specific points worth remembering:
(1). Regardless of the screen mode or color depth of the
image, the FFT and deconvolution algorithms treat all pixels
as monochrome. Thus, a 24-bit/pixel image is treated as a 24
bit deep grayscale image. In other words, the colors are not
deconvoluted separately in the current version of TN-Image.
(2). The grayscale mapping algorithm sets the most negative
FFT result to black and the most positive FFT result to white.
Thus, zero will be some shade of gray.
(3) Editing power spectra will lead to unpredictable results
in your image.
(4) Select "About...About the image" to view some of the FFT
parameters. These include:
Minimum FFT value (which is mapped to black)
Maximum FFT value (which is mapped to white)
FFT=0 color value (the color to which FFT values of zero are mapped)
FFT=0 RGB values (the corresponding red, green, and blue components
of the FFT=0 color value).
These numbers can be used to calculate the color values needed
to edit the image in the frequency domain to remove or accentuate
specific fequencies. The filtered image can then be reverse-
transformed to obtain the result.
(5) FFT's are displayed in the conventional manner, i.e. with
lowest positive frequencies at the top and left, lowest
negative frequencies on the right and bottom, and Nyquist in
the center, with the exception that only the real or imaginary
components are shown, as illustrated in the diagram below:
f=0 f=1/N ... f=Ò´ ... f=-1/N
f=0 -------------------------------
|\ | : |
f=1/N | 0,0 freq. | : |
| | : \|
. | | : \
. | | : |\
. | | : | \
| | : | This region of FFT is
f=Ò1/2 |--------------*--------------| not visible if image size
| |\ : | is not a power of 2
| | Nyquist : |
| | frequency: |
. | | :\ |
. | | : \|
. |..............|...........: \
| | |\
| | | image boundary if image size
f=-1/N ------------------------------- is not a power of 2
If the original image size is not an exact power of 2, a portion of
the FFT spectrum will not be visible. In this case, the Nyquist
frequency will not be in the exact center. If desired, you can
change the image size before calculating the FFT with the
"File...Create/resize image" option.
(6) FFT's should be done with as few other images present as possible.
Because an FFT is extremely memory-intensive, if TN-Image is forced
to use virtual memory, the FFT may take a very, very long time.
(7) When deconvoluting or convoluting, the two images should be
approximately the same size for optimal results.
(8) Avoid image sizes that are just larger than a power of 2, such
as 129 x 129 pixels. This will cause the complex array for FFT to
be allocated as the next higher power of 2 (i.e., 256 x 256).
(9) The screen mappings of FFT intensity values are automatically
rescaled whenever the FFT image is redrawn. Thus, changing the
contrast of an FFT'd image will appear to have no effect.
8.3.11.1 Convolution
View the image DECONVOL.TIF for a quick tutorial on convolution
and deconvolution.
Convolution -
Convolutes two images. Convolution is the same as multiplication
in the frequency domain. Therefore, the resultant image will have
the characteristics of both images. In the simplest possible example,
a sharp image convolved with an image of a blurred point will become
blurry. An image convolved with a single point is unchanged.
8.3.11.2 Deconvolution and image reconstruction
Deconvolution is a form of image reconstruction which was made
famous by successfully being used on the distorted images from
the Hubble space telescope. As with convolution, two images are
required. Typically, one of the two images is a point spread
function, or psf, which represents the effect of distortion on
a single pixel, and the other is the image from which this distortion
is to be removed. The two images must be approximately the same size.
For example, if your image is blurred by spherical distortion from
a bad lens, you would create an image the same size as your blurry
test image, but consisting of a single point in the upper left of the
image on a black background, subjected to the same blurring effect.
If the point spread function is known accurately, after deconvolution
the blur will be removed. In effect, a priori knowledge from outside
the image is used to remove the distortion.
In principle, any degraded image can be reconstructed by
deconvolution if the point spread function is known. If a photo
is blurred due to movement in one direction, the point spread
function would be a line in the direction of motion whose length
depends on the amount of movement. In practice, deconvolution will
not work for every image.
This method is far more powerful than using a "sharpening" filter,
because any arbitrary type of degradation of the image can be
eliminated. In practice, noise (especially noise in the psf) or
low precision in the FFT will cause inaccuracies in the recovered
image. For this reason, FFT's in TN-Image are maintained as
double-precision numbers. Also, if the spatial frequency of the
psf at any point happens to be zero, it will also be impossible
to reconstruct that point (since it would require dividing
by zero). Adding a little noise to the psf will ensure that all
frequencies are non-zero. Thus, sometimes it is necessary to
tolerate some noise in the psf to get good image recovery.
Important: The point spread function must be centered at the upper
left corner of the image to be used as a psf. Otherwise, a
translation effect will also be convoluted into or out of the image.
Exercise: Try deconvoluting fft1.tif and fft2.tif. It should be
possible to reconstruct the original image in fft1.tif, which was
a small square, despite the complicated point spread function in
fft2.tif which renders the distorted image unrecognizable. The more
complicated the point spread function, the more difficult it is to
recover a noise-free image.
8.3.11.3 Digital Filtering of images using the FFT
Digital filtering can be easily done while the FFT spectrum is being
displayed, by changing the pixels which correspond to the frequencies
you wish to change. This is most conveniently done by setting the
background color to "black" and using <delete> or <backspace> to
erase the frequencies you wish to remove; or by selecting "sketch"
(<F2>) and adding points at the desired frequencies by drawing with
the mouse. It is necessary to change both the positive and negative
frequencies to achieve good filtering. This means the entire FFT
matrix must be visible, i.e., the original image must be close to
a power of 2 in each dimension.
Example: High-pass filtering
1. Make sure the original image size is a power of 2.
2. Set background color to black by right-clicking on "black" in
the palette.
3. Forward-FFT the image.
4. Delete the low-frequency regions (as shown with a 'L') with the
'delete' key.
5. Alternatively, use the mouse to select these regions and use
"paint region", "change contrast" or "color/intensity" to make
them darker.
6. Optionally, you can also enhance the higher frequencies by
using "enhance contrast" in the high-frequency region (shown
by 'H'.
7. Drawing on a FFT'd image only affects the component being
displayed ("real" by default). Apply the same filtering
procedure to the imaginary component by selecting "FFT...
change display...imaginary" and repeat the changes.
LLLL---------------------LLLLL
LLLLL | LLLLL
| | |
| | |
| | |
| HHHHHHHHH |
|----------HHHHHHHHH----------|
| HHHHHHHHH |
| | |
| | |
| | |
LLLLL | LLLLL
LLLLL---------------------LLLLL
5. Reverse-FFT to obtain the filtered image. Note: Changing the
zero-frequency pixel (at the upper left corner of the FFT)
will have drastic effects on the image.
8.3.12 Macros
TN-Image can execute a series of predefined commands. This is
particularly useful when a large number of images need to be
processed in an identical manner. Technically, the macros in
TN-Image are not macros but small programs. The macro editor
can also edit small text files (up to 255 lines), making it useful
as a clipboard for making notes.
Macro commands consist of the text of one of the menu items,
followed by a series of parameters which are usually numeric.
Any menu item from any menu can be part of a macro, with the
following caveats:
1. Spaces should be replaced by underlines (_) or omitted.
2. Periods and check marks should be omitted.
3. Capitalization is not significant.
The numbering of command parameters corresponds to the
order in which the item would appear in the menu or dialog box.
It is not necessary to give all the parameters. If a parameter
is not given, it will be unchanged from the last time the command
was executed. Menu items useable as macros include:
Load_image Save_image Print_image Save_scan_data
Create/Resize_Image
Create_File_Format Erase_FFT Unload_image DOS_Command Quit
Delete_region Crop Erase_background Move Copy Spot_densitometry
Strip_densitometry Trace_curve Rotate_image Flip_horiz
Flip_vertically Filter Change_size Warp Measure calibration
Pixel_math FFT Backup Restore Macro Set_color Color/brightness
Contrast Change_palette Color_settings
Remap_colors Invert_colors Change_color_depth
Color->gray_scale Gray_scale->color Histogram
Line Circle Box Arrow Line_style
Text_direction Sketch Line_width Fill_region
Paint_region Curve Diffuse_Spray fine_Spray Add border
About_the_program About_the_file About_the_image
How_to_Register Show_menu_bar Menu_bar_2 Show_palette
Automatic_undo Redraw_menu_bar Show_OD_table Pixel_interact_mode
Spray_factor Cursor_size Signif_digits Help
Of course, some of these (such as "sketch" and "help") are not too
useful in a macro.
In addition to menu items, the following non-menu commands (described
later) can also be used:
beep
load
save
print
fill
dos
color
brightness
size
select_region
select_image
goto
loop
palette
exit
messages
convert
file_format
unload_all
resize_image
copy_image
You can cause the macro to ask for any parameter by substituting the
value with a question mark followed (with no spaces) by a prompt
string. For example, for the `load' command, the first parameter
is the filename. If instead of putting an actual filename in the
macro, such as
load myimage.tif
you use
load ?Filename
the program will ask you to enter a filename each time, by presenting
a message box like the following:
--------------------------------------
|Filename |
|____________________________________|
| |
| |
| |
| |
--------------------------------------
At this point, you can type the filename and press <Enter> to
continue. The prompt string cannot contain spaces, because a space
is interpreted as the beginning of the next parameter. There can
be any number of prompts for each command.
NOTE: no checking is done on the response to make sure it is a valid
answer. In the case of a filename, the macro interpreter itself does
not check whether the answer is a valid filename or even that a
filename is actually required for this parameter. Similarly, no
checking of your commands is done to make sure the macro is a valid
command. A command that is invalid, for example, by being misspelled,
will either be skipped, or if it generates a fatal error, will cause
the macro to be stopped.
8.3.12.1 Macro command summary
This is a partial listing of commands which require parameters.
Parameters must be specified in the indicated sequence and
separated by spaces. All parameters must be on the same line as
the command. Each command must be on a separate line.
Anything that appears in any of the menus may also be used as a
command. Those commands that do not require parameters are not
listed here. Some, such as 'automatic_undo' toggle a feature on
or off. For these commands, use the same command a second time
to turn the feature back on.
Unless noted otherwise, all parameters can be omitted. This
causes the current default setting to be used. Parameters cannot
be skipped. Thus, if you wish to set parameter #3, for example,
you also must set parameters #1 and #2.
If a fatal error occurs, the macro is automatically terminated
and an error message is displayed showing what line caused the error.
Command Parameter# Refers to Value Meaning
------- ---------- ----------- ----- -------
filter 1 filter type: 0 low pass
1 high pass
2 laplace
3 background subtract
4 background flatten
5 noise (median)
6 sharpen /
7 sharpen |
8 sharpen -
9 edge detect -
10 edge detect |
11 sobel
2 kernel size: 1 3x3
2 5x5
3 9x9
4 15x15
3 amount of filtering (1-10)
4 range (for median filter) (any integer)
5 kernel multiplier (any integer)
6 maximum background:
0 black
1 white
Examples: filter 5 1 3 10 1 1
Filters the currently-selected
image or area using a 3x3 median
filter, with a filtering level
of 3, a range of Ò10, kernel
multiplier of 1, and white declared
as the background.
filter 11 2
Filters the currently-selected
image or area using a 5x5 Sobel
filter.
select_region Sets boundary for other operations such
as contrast. The coordinate values are
relative to the upper left corner of the
screen (= 0,0). Select_region is cancelled
by select_image and vice versa. All 4
parameters must be given.
1 upper left x coord.
2 upper left y coord.
3 lower right x coord.
4 lower right y coord.
Example: select_region 100 100 200 200
This has the same effect as clicking-and-
dragging the mouse from (100,100) to (200,200).
select_image 1 image no. NOTE: Image numbering changes
unpredictably when an image is
unloaded. This is because images
are rearranged to compact the
free space.
Example:
select_image 5
Has the same effect as double-clicking on
image #5.
load 1 filename (can include wildcards)
2 x position for upper left corner
3 y position for upper left corner
4 x size (0 to 1) (1=full size)
5 y size (0 to 1)
The remaining arguments (6 to 15) are used only for
reading raw images.
6 platform 0 = PC
1 = Mac
2 = IBM
7 color type 0 = RGB color
1 = grayscale or pseudocolor
2 = CMYK color
8 bit packing 0 = TIF-like
1 = GIF-like
2 = none
9 x size in pixels
10 y size in pixels
11 no.of bytes to skip at start of file
12 bits/pixel of image
13 red bits/pixel of image
14 green bits/pixel of image
15 blue bits/pixel of image
16 black bits/pixel of image
Examples: load myimage.tif 100 100 1 1
Reads myimage.tif from disk, positions it at
(100,100), at full size.
load *.gif
Reads all .GIF files from disk. Since no
position or size is specified, the values
set by the previous command will be used.
The most recently loaded image becomes
the currently-selected image for other
operations.
Example: Load an image of raw bytes.
file_format 9
load raw.img 0 0 1 1 0 1 0 382 362 10 8
The first command is necessary to override
the automatic file detection, which would
otherwise display a message "Invalid file
type".
The second command loads the image at x=0,
y=0, x size=100%, y size=100%, platform=PC,
color type=pseudocolor, x size=382 pixels,
y size = 362 pixels, skip 10 bytes, and
interpret data as 8 bits/pixel.
If a large number of raw byte images having
identical parameters are to be read, it is
easier to create a custom file type and
define these values as the defaults. This
will eliminate repetitive retyping of the
arguments.
save 1 filename
2 file format -see under "file_format" for
permissible values
3 bits/pixel (Any value between 1-32. Must
be a legal value for the specified format
otherwise it is a fatal error. If omitted,
it uses the image's current bpp.)
Example:
save test.tif 0
Creates a TIF file named "test.tif" using
the currently-selected area or currently-
selected image.
If no arguments are given, the image's
original filename and format will be used.
Use `file_format' to override the default
image format. You must change the extension
manually in case the file is to be read by
file viewers, which may require a
specific file extension. If the image was
created within TN-Image it will not have a
filename until you save it. If a macro tries
to save a file without specifying a filename,
a fatal error occurs, terminating the macro.
color,
brightness
1 change in brightness for monochrome portion
of selected area if any (If the entire area
is color, this parameter is ignored).
2 change in red for color portion if any
3 change in green for color portion if any
4 change in blue for color portion if any
If the entire area is monochrome, parameters
2-4 are ignored.
Example: To increase the red in a color image by 10:
color 0 10 0 0
The color, brightness, and color_brightness commands
are synonymous.
contrast
1 change in contrast for monochrome portion
if any (1 = no change)(If the entire area
is color, this parameter is ignored).
2 change in red contrast for color portion
3 change in green contrast for color portion
4 change in blue contrast for color portion
If the entire area is monochrome, parameters
2-4 are ignored.
Example: To increase blue contrast in a color image
by a factor of 1.5:
contrast 0 0 0 1.5
convert,
change_color_depth
1 bits/pixel to convert image to (must be 8, 16,
24, or 32).
change_palette,
palette 1 Palette number 1 - gray scale
2 - spectrum
3 - multi colors 1
4 - multi colors 2
5 - multi colors 3
6 - RGBI
7 - black to green
8 - zebra
-1 - Other (randomly-generated)
0 - Other (e.g., inverse)
unload (No parameters, unloads currently selected image,
Use 'select_image' command to select an image.)
unload_all Unloads all images. If `messages' is `on', you are
prompted to save any image that has been modified.
quit Quits the program and asks if you want to save
your changes.
exit Quits the program WITHOUT asking if you want
to save your changes. Useful when running TN-Image
macros in batch mode (See "Batch-mode processing").
goto 1 line number in macro to execute next.
A jump to a lower line number causes an
infinite loop. Press <ESC> to stop the
macro.
loop Causes the macro to be repeated. Each time
a message box appears asking if you want to
repeat the macro - you must type a 'y' or 'n'.
pixel_interact_mode Set
1 Pixel inter- 1 Overwrite
action mode 2 Maximum
3 Minimum
4 Add
5 Subtract new - old
6 Subtract old - new
7 XOR
8 Average
9 Superimpose
dos
dos_command 1-5 Execute a DOS command
Example: dos pkunzip image.zip
messages 1 Disables messages, including all requests
for confirmation and requests for filenames.
Messages are automatically re-enabled after
the macro ends. Useful in batch mode. Turning
messages off is dangerous and should only be
used in fully-debugged macros. If messages
are turned off, a macro could overwrite
files, unload images, create a file in a
non-standard format, or exit to DOS without
asking for confirmation.
0 Messages off
1 Messages on
Example: messages 0
fft 1 Direction 1 Forward
2 Reverse
3 Convolute 2 images
4 Deconvolute 2 images
5 Change display only
2 Display 1 Real
2 Imaginary
3 Power spectrum
3 Image #1 (may be left blank for FFT of
currently-selected image)
4 Image #2 (required for deconvoluton)
Examples: fft 1 1 (forward fft)
fft 4 1 7 8 (deconvolute images
7 and 8)
macro 1 Macro file name. Control is transferred
to the first line of the new macro. After
the new macro is finished, the old macro
continues. There is no limit on the depth
of nested macros except as imposed by
available memory. Do not create recursive
macros (macros which call themselves
directly or indirectly).
file_format 1 Sets the default file format for loading
and saving images.
-1 (automatically detect)
0 NONE
1 TIF
2 PCX
3 IMA
4 IMG (Frame grabber)
5 GIF (GIF87a)
6 IMM
7 GEM
8 IMDS
9 RAW
11 JPG
12 TARGA (Targa RLE)
16 BMP (Windows bitmap)
23 ASCII
100 first custom format
101 2nd custom format
...etc.
This will supercede the image's existing
default file format for the duration of the
macro.
Example: file_format 5
= sets default format to GIF
create_image
resize_image
1 Method for obtaining image coordinates.
1 Use mouse
2 Use specified coordinates
3 Copy another image
4 Resize another image using
specified coordinates
2 Border 0 No border
1 Add border
3 x size (in pixel units)
4 y size (in pixel units)
5 x position (0,0 = upper left)
6 y position (0,0 = upper left)
7 No. of image to copy. Remember that the image
number changes unpredictably if an image
is unloaded. If the image no. does not exist,
it is an error.
8.3.12.2 Macro Programming Guide
-----------------------
Here is a brief tutorial on some of the finer points on creating
useful macros. In general a macro should reset the program to its
original state. If a macro does something different the second
time it is executed, the cause is almost always a failure to reset
the original conditions. In a real macro, you should also always
execute "select_image" or "load" first to make sure the operation
is performed on the correct image.
Example macro #1: Nested macros
Macro "beep.mac"
Line # Command Note: the words "Line #" and "Command"
------ ------- and the numbers 1,2, and 3 are not part
1 beep of the macro. In this example, the macro
2 beep would consist of only 3 words ("beep"),
3 beep one on each line.
Macro "test.mac"
Line # Command
------ -------
1 macro beep.mac
2 beep
Executing "test.mac" should cause a total of 4 beeps.
A macro must never call itself - this would cause a system hang.
Example macro #2: Converting GIF image to TIF format interactively
Line # Command
------ -------
1 load ?Filename
2 messages 0
3 file_format 0
4 save
5 messages 1
6 loop
Line 1 - Prompts you for a filename each time (because of the
question mark).
Line 2 - Resets default file format to 0 (TIF). If this line is
omitted, the file format would default to the original format
of each image.
Line 4 - Saves the image in TIF format. Don't forget to rename
the file extension to TIF later. You could also use:
save ?Filename_to_save_as ?Format
which would ask you for both the filename and the format
each time.
Line 6 - Unconditional loop back to line 1. Press <ESC> to stop.
Example macro #3: Converting GIF image to TIF format in batch mode
Line # Command
------ -------
1 messages 0
2 load *.gif
3 file_format 0
4 save
This macro could be executed at 3 a.m. by setting the following
timed events in TNSHELL or other command scheduler:
Event 1: cd c:\tnimage 3:00am
Event 2: tnimage -macro convert.mac 3:01am
Event 3: ren *.gif *.tif 4:00am
Event 4: cd c:\ 4:01am
Event 3 could also be replaced by a new line in the macro:
dos ren *.gif *.tif
Make sure there is enough free disk space before starting this
macro.
Example macro #3: Subtracting two images
Line # Command
------ -------
1 pixel_interact_mode 1
2 load cells.tif 0 0 1 1
3 pixel_interact_mode 5
4 load cells.tif 1 1 1 1
5 pixel_interact_mode 1
6 contrast 1.85
This macro loads an image, then subtracts the same image
after offsetting it by (1,1), then increases the contrast.
All 6 lines are essential for a good macro.
Line 1: The pixel interaction mode is set to 1 (overwrite)
in case a previous operation changed it.
Line 2: All 4 parameters (x offset, y offset, x size, and y
size) must be given. Otherwise, if the macro was executed again,
the default parameters would be { 1,1,1,1 } because of line 4.
This would cause the image to be placed at (1,1) and then
subtracted from itself, giving solid black.
Line 3: The pixel interaction mode is set to 5 (subtract).
It is usually helpful to change the screen background color to
0 (black) before doing this.
Line 4: Load the image to subtract.
Line 5: Reset the pixel interaction mode to overwrite.
Line 6: Increase the contrast by a factor of 1.85.
Be careful using "DOS command" in combination with "messages 0".
If there is insufficient low DOS memory to execute the command,
"messages 0" may cause you to miss the fact that the command
was not executed.
8.4.0 Color menu
Palettes are only needed for indexed-color (8-bit/pixel) images.
If an 8-bit (256-color) image which lacks a palette of its own
is loaded and converted to color, the most recently-selected
palette will be used to perform the conversion.
8.4.1 Invert palette
Switches the palette so that all images become a negative.
Changes the appearance only, and has no effect on the actual
pixel values in the image.
8.4.2 Color intensity / brightness
There are 3 ways to change the brightness: you can drag the
palette bar to change the color LUT (palette), or you can select
"Color intensity" or "Change pixel values" from the menu.
8.4.2.1 Changing brightness using the palette bar
This method is very fast, but only works on images that have a
continuous colormap, and only in 8-bit/pixel screen modes.
Files with a discontinuous colormap should be adjusted using the
"Color intensity" menu option instead of the palette bar.
Click on the top part of the bar and drag down to "squash" the
colors downward, or click on the bottom part of the bar and drag
up to squash the colors upward. This increases the contrast in
all images of the screen.
Then, click in the middle of the bar and drag up or down to adjust
the brightness as desired. The currently-selected image will be
set to contain the new palette.
If you change the palette from the menu, or select "restore original
palette", the brightness and contrast settings return to normal.
8.4.2.2 Changing brightness and color using the menus
This method is also fast, and allows you to change the red, green,
blue, and intensity values independently. The action is different
depending on the screen mode.
For 8 bit/pixel modes, the colormap (palette) of the image is
changed. The pixel values in the original image is unaffected.
It is not possible to change the color of only part of the image
with this method. To change a portion of the image, you must either
use "Change pixel value" or convert the image to 24 bits/pixel
first.
For true-color screen modes, the action is the same as "Change
pixel value" (see below). A value is added or subtracted for the
red, green, and blue components of the currently-selected image or
screen region, making it darker or lighter or altering its color
balance. The original colors can be restored by selecting
"Image..Restore".
8.4.3 Contrast
There are also two ways to change the contrast: you can drag the
palette bar to change the color LUT, or you can select "Contrast"
from the menu.
Changing the LUT is much faster, but only works in 8-bit
(pseudocolor) screen modes, and it always changes the entire screen.
Selecting "Contrast" from the menu works in all screen modes, and
can be used to change contrast in selected regions of an image.
8.4.3.1 Changing contrast using the palette bar
Click on the top part of the bar and drag down to "squash" the
colors downward, or click on the bottom part of the bar and drag
up to squash the colors upward. This increases the contrast in
all images of the screen.
Then, click in the middle of the bar and drag up or down to adjust
the brightness as desired. The currently-selected image will be
set to contain the new palette.
If you change the palette from the menu, the brightness and contrast
settings return to normal.
8.4.3.2 Changing contrast using the menus
For 8 bit/pixel images:
Multiplies all pixels in the currently-selected image or screen
region by a value (100=no change), increasing the contrast.
Note that if the contrast or brightness is increased or decreased
too much, information will be lost from the image due to saturation.
***NOTE***WARNING***CAUTION***ATTENTION****READ THIS**************
| |
| When using 8 bit/pixel modes, adjusting the contrast, or |
| making the image lighter or darker, may invalidate the |
| correspondence between pixel values and the original optical |
| density in the image. This will occur if the O.D. table for |
| the image is non-linear and densitometry is done with `pixel |
| correction' set to `on'. The numerical results obtained by |
| scanning under those conditions could be scientifically |
| invalid. |
| |
| If you plan to quantitatively analyze your image after altering|
| its contrast or brightness, first check that the O.D. table for|
| the image is a straight line (Select `Configure...Show O.D. |
| table'). Alternatively, set `pixel compensation' to `off' |
| before any quantitative analysis. |
| |
| This warning does not apply to changes made by dragging the |
| palette bar. |
******************************************************************
For color images:
Multiplies the r,g, and b components of all pixels in the
currently-selected image or screen region by separate values
(100=no change), increasing the contrast.
If the selected region has both color and monochrome pixels,
you can select independent contrast factors for the monochrome
intensity and the red, green, and blue components of the color
region.
8.4.4 Change palette (colormap)
In 8-bit/pixel modes, each pixel value is translated through a
"palette table" which you can easily modify in TN-Image. The
new table is saved along with the image (for TIF,BMP,and TGA
files) so the next time you load the image, the display changes
to the modified palette. Changing the palette has two advantages
over other methods of changing brightness or color: (1) it is
much faster, and (2) it is always reversible since it never
affects the original image data. The disadvantages are that
changing the palette only works in pseudocolor screen modes,
and it always changes the entire screen. If you need to brighten
just a portion of the screen, use the "color intensity/brightness"
menu option.
In color modes, the current palette table is used as a guide
to determine how an monochrome image is converted to color when
it is loaded from disk, but does not otherwise affect the display.
8.4.4.1 Select palette
You can select from a variety of different color palettes.
Changing the palette has no effect on the image when it is
stored or densitometrically analyzed. However, it can be used
to enhance the visibility of details in the image. Each image
can have a different palette.
The following pre-set palettes are available:
Gray scale - continuous shading of 256 levels of gray.
Multi-color 1 - a continuous blend of colors useful for
enhancing low-contrast images.
Multi-color 2 - a discontinuous sequence of short color
gradients
Multi-color 3 - a discontinuous sequence of color gradients
arranged oppositely from multi-color 2.
RGBI - 4 continuous gradients, 0-63=red, 64-127=green,
128-192=blue and 193-255=gray scale.
Spectrum - A single continuous gradient from blue through the
colors of the spectrum to red and then white.
Black to green - Same as gray scale except black to green
instead of black to white.
Zebra - Alternating black and white - useful for finding
very subtle patterns in the image. Creates a
contour-line effect.
Brightness - Lightens or darkens palette, increasing or
decreasing color saturation.
Other - User-selected palette. Select the desired number with
the mouse to select from a wide range of
different computer-generated palettes.
1-100 = Various gray scales
101-1000 = randomly-generated gradients. The
amount of color gradually increases
in intervals of 100.
1000-10000= continuous, smooth gradients without
sharp breaks in the colors. The number
of light and dark cycles varies from
1 upwards. Some are a single color,
others are gray scales, and others
are multiple colors.
Example: 2345 = shades of `gold'
8.4.4.2 Grayscale intensity mapping
Grayscale images of greater than 8 bits/pixel often contain subtle
details which would not ordinarily be visible. This option permits
interactively changing the way the pixels are mapped to the screen,
creating, in effect, a "sliding scale".
This sliding scale uses 4 parameters: the maximum and minimum
values in the image to display, and the maximum and minimum
values on the screen to which these are mapped (these latter 2
do not normally need to be changed). When a monochrome
image is first loaded, TN-Image automatically determines the
maximum and minimum values in the image to allow the entire image
to be viewed. By selecting "Grayscale brightness", you can use the
mouse to select the actual range of values to be displayed.
For example, if the image has 12 bits of grayscale depth, it will
be possible to set the maximum and minimum to any number between 0
and 4096. Setting the numbers close together enhances the contrast
in that intensity range. Similarly, making the numbers small
enhances the contrast in the darker areas of the image. To make
the change visible, click on "Preview".
The maximum can also be lower than the minimum, creating an
inverse image. Each image on the screen can have a different
brightness/contrast level.
Note: Color images must be converted to monochrome before this
feature can be used.
8.4.4.3 Read palette
Reads a palette file from disk. Palette files are ASCII text
files which can be created with a text editor, or created
graphically within TN-Image (see `Create palette').
If you create a palette file manually, your palette file
should consist of 4 columns of up to 256 rows. The first
column is the color number or `index', an integer between 0
and 255, indicating which color. The other 3 columns are
integers between 0 and 63, which define the amount of red,
green, and blue respectively for each color. For example:
0 0 0 63
1 63 63 63
255 7 7 7
This file would set color 0 to light blue, color 1 to bright
white, and color 255 to dark gray. All other colors would be
unchanged (Normally, a palette file would have 255 rows
instead of only 3).
8.4.4.4 Save palette
Saves the current palette into a disk file.
8.4.4.5 Create palette
Allows you to graphically create a custom palette. There are 3
boxes, one for red, green, and blue, which graphically
represent the red, green, and blue intensities of each color
in the palette. To change the palette, click on the graph
corresponding to the desired color and trace out the desired
new graph while holding the left mouse button down. The graph
and palette will both adjust in real time to reflect the new
values.
Clicking `smooth' causes the computer to automatically smooth
out the newly-drawn curve to create a more even dispersal of
colors in your palette. When you are satisfied with the new
palette, click on "OK".
8.4.4.6 Invert palette
Inverts the color look-up table so the image appears as a
negative. This differs from "invert colors" in that inverting
the palette has no effect on the actual image data. The two
extreme colors (black and white) are not switched.
8.4.4.7 Rotate palette
Rotates the palette table through all 255 colors. This effectively
increases the number of predefined palettes to 2.5 million. Useful
in achieving fine control of the appearance of the image and
enhancing subtle details.
If you find a number that gives a useful effect, write the number
down for future reference or save it using "Save Palette". The actual
pattern of colors in the palette is not easily predictable from the
color number. (Saving the currently-displayed screen or a portion
of it as a TIF or PCX file, or selecting `Save palette' will also
save the palette.)
8.4.4.8 Restore original palette
Restores the palette the image had when it was originally loaded
from disk. Useful when you accidentally rotate the palette of
a GIF file.
8.4.5 Remap colors - Changes the colors in an image by substituting
from a map file. It acts differently on pseudocolor and color images.
8-bit/pixel images:
Changes the pixels in the image or screen region by substituting
from a set of values specified in an ASCII file. This file should
consist of a list of 2 columns of numbers. The 1st column is the
pixel value to change, the 2nd column should be the desired new
values. For example:
1 255
2 200
3 180
4 175
255 0
This file would change all pixels with a value of 1 to pixels
with a value of 255, those with values of 2 to 200, 3 to 180,
4 to 175, and 255 to 0. Any other pixels would be unaffected.
Typically in a remap file, you would remap all 255 colors, but
this is not essential. Be sure colors 0 and 255 do not
accidentally get remapped to the same value, otherwise it will
be impossible to use the menus.
The most common use of this is to reduce the number of separate
intensity values in an image, by eliminating those values in regions
that are not of interest. This can greatly improve the compress-
ibility of an image.
Another use is to stretch the contrast. Since the new intensity
values can be known in advance, contrast enhancement can be done
on multiple images in an exactly reproducible manner.
The Macro Editor in the Registered version can be used to create
remap files without leaving TN-Image.
Color images:
Interchanges r,g, and b color values. This could be used, for
example, to convert an image to a single color or to correct
for color errors in a corrupted image file.
8.4.6 Invert colors
Changes the image into a negative. This differs from "invert
palette" in that the pixel values themselves are changed.
8.4.7 Change color depth
Converts the selected image to a different number of bits per
pixel. This option only works on entire images. When working
with pseudo-color images, it is necessary to use this option to
convert them to color images before filtering them (see "Filtering
color images") or using other operations that assume the image
is color. Images can be converted from any depth (8,16,24,or
32 bits per pixel) to any other depth.
If the starting image is an 8-bit image with a palette, the
palette colors are used to select the appropriate colors for
the new image. These can be easily changed (see "Change palette").
If the starting image is a color image, and it is being converted
to 8 bits/pixel, the currently-selected palettization method is
used to calculate the colors. The default method is "quantization".
This can be changed (see "Color Settings").
Once converted, writing the image to disk will cause it to be
saved in its new depth.
8.4.8 Color -> Gray scale
Converts the image from color or pseudo-color to gray scale
(luminosity). The relative contributions to luminosity from
the red, green, and blue components are determined by the
"Luminosity factors" which can be changed by selecting
"Color...Color settings".
The default is: value = .299*r + .587*g + .114*b
The results for 8-bit images may be different from the results
of merely changing the palette to gray scale, because for 8-bit
images, the conversion creates a new palette to match the intensities
in the image as closely as possible.
8.4.9 Gray scale -> color
Deactivates grayscale mapping, reactivates color manipulation
features, and tries to restore previous color information if
possible.
8.4.10 Histogram
Plots a histogram of the no. of pixels with a given value
within the selected area vs. the pixel value. Quite useful
when trying to optimize the contrast or brightness of an
image. Clicking on the edge of the histogram allows you to
move it to some other screen location in the same manner as
moving the dialog boxes and click boxes.
Clicking `capture' allows you to capture all or part of the
graph into a new image. After clicking on `capture', use the
mouse to select the desired portion of the graph. A new image
which includes that region is then automatically created.
Clicking `subtract baseline' allows you to subtract a baseline
from the histogram. Select the desired baseline by clicking as
many times as desired to create the baseline curve. The
baseline curve is constructed using a B-spline (see under
`B-spline curve'). You can modify the curve as desired by
clicking and dragging the small boxes (which represent control
points for the curve). Up to 200 control points can be used.
The control points do not have to be within the graph region;
however, any negative numbers created by baseline subtraction
are truncated to 0's.
See `strip densitometry' above for more details on the plot
functions.
Note: When a graph is being displayed, smoothing, subtracting
baseline, etc., affect the displayed data only, and have no
effect on the image.
8.4.11 Change pixel value
This menu option was previously called "Change brightness/contrast".
The effect is consistent across all image types and screen modes,
but is slower in 8-bit modes than the "Change brightness" option.
For 8 bit/pixel images:
This adds a value (-255 to 255) to all pixels in the currently-
selected image or screen region, generally making it darker or
lighter. (The actual effect on the image will depend on the
palette).
NOTE: See the warning under "Contrast".
For color images:
This adds or subtracts a value for the red, green, and blue
components of the currently-selected image or screen region,
making it darker or lighter or altering its color balance.
8.5.0 Draw menu
Most of the drawing operations listed below put TN-Image in the
drawing mode, in which each mouse click creates another graphic
element. To return to normal mode, click anywhere on the top menu
bar.
8.5.1 Set color
Allows you to change the foreground and background colors. The
foreground color is used for all text, lines, circles, spray,
arrows, etc. The background color is used for the backspace
and delete keys, and when erasing an image from the screen.
You can also change the foreground color by clicking the left
mouse button when the mouse cursor is pointing to the desired
color in the `palette display' (the long vertical bar or
square at the right of the screen). Similarly, the background
color can be changed by clicking the right mouse button on the
palette display.
8.5.2 Line
Draws lines. Click at the starting position, drag to the end
position, and then release to draw a straight line. Click
anywhere on the top menu bar to return to normal mode.
8.5.3 Circle - Draws circles of the specified size.
8.5.4 Box - Draws boxes by the click-and-drag method.
8.5.5 Arrow - Draws an arrow. After selecting `arrow',
move the mouse cursor to the desired
location and click the left mouse button.
An arrow will be drawn at that position.
8.5.6 Curve - Draws a curve or line defined by user-selected
control points.
8.5.6.1 Bezier curve -
Draws a smooth curve. Click on the desired locations for the
control points. At least 3 points are required to draw a curve.
The position of each control point is indicated by a small box.
The control points can be moved interactively by clicking on an
existing box and dragging it to a new location. Clicking
outside a box creates a new control point. When you are
satisfied with the shape of the curve, pressing any key erases
the small boxes and makes the Bezier curve permanent. You can
have a maximum of 199 control points.
8.5.6.2 B-spline curve
Similar to Bezier curve, except has a maximum of 196 control
points. B-spline curves differ from Bezier curves in that the
curve tends to be closer to the control points and sharper in
appearance.
8.5.6.3 Least-squares line - Fits a straight line between the control
points using a least-squares algorithm.
8.5.6.4 Polygon - Draws a polygon through the control points.
8.5.7 Text direction - Toggles between normal and 90¯ rotated text.
8.5.8 Font
Currently, fonts are only available on the Unix version. You can
select from one of the 10 default fonts typically available on X11,
or click on "other" to enter a font specification in X11's format
(e.g., *lucida-medium-r*100*). See the X man pages for additional
information. You can also select the stroke weight (medium or bold),
or the point size (10 -24). Checking "vertical text" causes the text
to be printed sideways. Checking "opaque text" causes the background
to also be drawn, using the current background color.
8.5.9 Sketch - In sketch mode, whenever the left mouse button
is pressed, a continuous line is drawn on
the screen. Sketch mode is also toggled
on/off by the F2 key.
8.5.10 Fill region - Flood fill
Fill type
Solid - fills a region with a constant color
Horiz.Gradient - fills a region with colors increasing or
decreasing left to right
Vert.Gradient - fills a region with colors increasing or
decreasing top to bottom
Solid fill color - Used for `solid' fills only. Specifies the
color to be used when filling.
Max border color -
Min border color
In a flood fill, all pixels in a given region bounded by a
"border color" are changed. Outside the border, the image is
unchanged. In TN-Image, instead of one single border color,
you can select a range of colors. Any pixel within that range
will act as a border. For example, if you set Max. border
color = 200 and Min. border color = 127, then only the region
containing pixels less than 127 or greater than 200 will be
filled. This is useful since many real-world images do not
contain a single continuous line of pixels which could serve
as a "border".
If you try to fill a bounded region (such as a box), the color
of the boundary must be between the minimum and maximum border
colors. Otherwise, the color will spill out of the region and
possibly ruin other images on the screen.
8.5.10.1 Gradient fill
Grad start coordinate
Grad end coordinate -
Specifies the starting and ending referende coordinates that will
be used to calculate the color. The closer the starting and ending
coordinates are to each other, the steeper the gradient. The "Start
Gradient Color" will be used at the Start Coordinate and the "End
Gradient Color will be used at the End Coordinate. All other colors
will be calculated from these 2 points. Note that filling itself
is bounded by the Border Color and not by the Start and End
coordinates.
For horizontal gradients, use x values for the start and end
coordinates; when making vertical gradients, use y values.
For 8 bit/pixel screen modes:
Start gradient color
End gradient color - Selects the intensity value that is to be
used at the starting and ending coordinates,
respectively.
For other bit/pixel screen modes:
Start gradient red
End gradient red
Start gradient green
End gradient green
Start gradient blue
End gradient blue - Selects the RGB color value that is to be
used at the starting and ending coordinates,
respectively.
These parameters specify the color values to use at the gradient
starting and ending coordinates. Note that the "starting" color
can be larger or smaller than the "ending" color. This gives
greater flexibility, especially in true-color modes, for creating
a blend of one color into another.
Sometimes, as when filling the inside of letters in text, it is
desirable to have the appearance of the same gradient extending
out of sight between the letters. This can be done easily in
TN-Image, simply by not changing the starting and ending gradient
colors. Clicking inside each area to be filled sequentially will
cause the same colors to be used as if the entire region had
been filled with a gradient.
Special care should be given to starting and ending r,g, and b
values when working in 15- and 16-color modes. You should
specify slightly different starting and ending values for each color
in order to avoid a "stepped" appearance of the gradient. This
prevents all 3 colors from being incremented at the same place
on the screen, due to the fact that each color only has 31 or 63
discrete values.
Example 1:
Creating a rectangular area with a gradient increasing in brightness
from left to right.
1. Start TN-Image in mode 103 by typing:
tnimage -mode 103
2. Click on the palette to select a light color, e.g., 250.
3. Select "Draw...Box" and draw a box. Note that the box is drawn in
color 250.
4. Make a note of the starting and ending x coordinates of the box
(Shown on the menu bar).
5. Select "Draw...Fill region".
6. Click on "Horizontal gradient".
7. For "Grad start coordinate" enter the leftmost x position of
the box.
8. For "Grad end coordinate" enter the rightmost x position of
the box.
9. Enter 251 and 249 for "Max border color" and "Min border color",
respectively. The flood fill will stop at any pixel that is a
249, 250, or 251.
10.For "Start gradient color" and "End gradient color" enter 0 and
255, respectively. This will cause the color to change from 0
to 255 as x changes from the starting to ending coordinate of
the box.
11.Click on "OK".
12.Move the mouse to any point inside the box and click. The box
should fill up with the gradient.
Example 2:
Removing a gradient background from an image (flattening the
background).
If an image is too light on one side and too dark on the other,
one way to fix it is by adding or subtracting an artificial gradient.
In the Registered version, this can be done automatically, by
selecting "Filter...Background Flatten".
1. Move all images off to one side to create a blank area on the
screen.
2. Select "Color...Set colors" and change the background color to
black (0) and the foreground color to white (e.g.,255).
3. Draw a box as in Example 1, slightly larger than the image that
has the uneven background.
4. Set the Grad Start and Grad End Coordinates to match the position
of the box.
5. Set the Max and Min Border Colors so that the color of the box
is between the Max and Min Border Color.
6. Set the Start and End Gradient Colors to values which, when added
to the corresponding parts of the image, will equalize the
intensity. For instance, if the image colors are mostly 10-20 on
the left and 90-100 on the right, set the Start and End Gradient
Colors to 80 and 0, respectively. The imarge should be dark enough
so that adding these colors will saturate the image. If the image
is too light already, you should set the Start and End Gradient
Colors to 0 and 80, respectively, and use "Subtract" instead of
"Add" below.
7. Fill the box with the gradient.
8. Move your image back onto the screen (don't cover the gradient).
9. Select "Configure...Set pixel mode" and click on "Add".
10. Select "Image...Copy" and click-and-drag to copy a region from
your image. Paste it on top of the gradient. The image will be
"added" to the gradient.
11. Select "Configure...Set pixel mode" and set the pixel mode back
to "Overwrite".
12. Select "File...Create Image" and select the area you just pasted.
This will put the modified area into an image buffer.
13. Select "Image...Erase Background" to clean up the desktop.
8.5.11 Paint Region
Sets a rectangular region to the foreground color. After
selecting `paint region', move the mouse cursor to one corner
and click and drag to the other corner. The selected area will
be painted.
8.5.12 Diffuse spray
Creates a spray-paint effect. Click the left mouse button at
the center of the region to be sprayed. The area covered is
determined by the "spray factor" in the "configuration" menu.
8.5.13 Fine spray
Creates a solid painting effect. Click the left mouse button at
the center of the region to be sprayed. The area covered is
determined by the "spray factor" in the "configuration" menu.
8.5.14 Add border - Puts a border around the current image. The border
color is selectable.
8.6.0 About menu
8.6.1 About the program - Displays the version number, amount of
free memory, the number of images
currently loaded, the number of images that
have been backed up, and the x and y starting
position of the current (top) image. You can
also use this option to switch to a different
image, by selecting the desired image from
the list with the arrow keys or mouse, and
pressing <Enter> or clicking on <OK>.
8.6.2 About the file - Displays a variety of technical information
about your image file. This is useful in
diagnosing problems with reading a possibly
corrupted file or in getting parameters from
an unknown file format such as that produced by
certain specialized frame grabbers.
8.6.3 About the image - Displays a variety of information about the
currently-selected image, including whether
it is backed up, has an FFT, its original
filename and image depth, etc.
8.6.4 How to register - Displays vital information concerning how to
register your copy of TN-Image and obtain a
more powerful version along with technical
support.
8.7.0 Configure menu
8.7.1 Show menu bar (DOS)
If checked, the menu bar at the top will be continuously visible.
Sometimes it is convenient to make it invisible, as when
photographing the screen. Even when invisible, clicking on the
appropriate region will still activate the menu.
8.7.2 Show menu bar 2 - Displays additional information. Toggles
the second menu bar on/off. (DOS)
8.7.3 Show palette - If checked, a vertical palette strip or box will
be drawn. (DOS)
8.7.4 Redraw menu bar - Re-draws the menu bar, in case some
operation wrote on top of it. (DOS)
8.7.5 Redraw palette
Click the left mouse button to indicate where the new palette strip
should go. The palette is redrawn. The palette is always kept in a
window of its own, separate from the images. The palette can be used
to select the foreground and background colors (by clicking the left
or right mouse buttons, respectively, on the desired color).
8.7.6 Show O.D. table -
Draws a graph showing the correspondence between pixel values (0
to 255) and optical density, as calculated by the scanner.
Typically, only TIF files from scanners have an O.D. table
(referred to in TIF files as a `gray response curve'. If the
image does not provide one, TN-Image will create a linear O.D.
table. (Note: most Macintosh TIF files do not have O.D. tables.)
The O.D. table is only meaningful in monochrome/indexed-color
modes (8 bits/pixel). It is also known as a "gamma correction
table". Each image can have a separate O.D. table.
Changing this O.D. table is possible but not recommended.
8.7.7 Pixel interact mode -
Selects how 2 pixels interact with each other when you copy and
paste parts of an image, read an image from disk, or add graphical
elements.
Overwrite - Default mode. The new pixel erases the old pixel. This
is by far the fastest mode.
Maximum - The larger of the 2 values is used.
Minimum - The smaller of the 2 values is used.
Add - The 2 values are added (up to the maximum value).
Subtract - The new value is subtracted from the old value (with a
minimum result of 0).
XOR - The 2 values are XOR'd with each other.
Average - The 2 values are averaged.
Superimpose - The new pixel replaces the old pixel unless the new pixel's
value is 0, in which case the old pixel is unaffected (allows
superimposing images with parts "masked out").
Example 1: Finding subtle differences between two images (also creates a
silhouette effect).
(1). Load an image into TN-Image.
(2). Select "Pixel interaction mode...Subtract".
(3). Select "Load image" and change "x position" and "y position" to 2.
(4). Click on "OK".
(5). You now have a subtracted image. (It may be necessary to make it
lighter or increase its contrast.)
Example 2: Creating contour maps of an image.
(1). Load an image into TN-Image.
(2). Select "Pixel interaction mode...XOR".
(3). Select `copy', and click-and-drag to select a portion of the image.
(4). Release the mouse button.
(5). Move the mouse to a location 1 pixel to the right and 1 pixel
below the original position and click the mouse button to put
the copy in place.
(6). You now have a crude contour plot of your image. The gradient
sensitivity of the contour plot can be decreased by using an
offset of 2 or more pixels in step (5). You can also "threshold"
the plot by subtracting a value ("make darker") and then adding
it back("make lighter").
Example 3: Reducing chunkiness in image.
(1). Read an image into TN-Image.
(2). Select "Pixel interaction mode...Average".
(3). Select "Load image" and change "x position" and "y position" to 2.
(4). Click on "OK".
(5). You now have an image that is smoother without becoming blurred.
Don't forget to change "Pixel interact mode" back to "Overwrite"
afterwards.
NOTE: Don't forget that, when loading an image, unless the
interact mode is "overwrite", the image will interact not only
with other images but also with the background in areas where no
image is present. Thus it may be helpful to set the background
color to black first, to avoid unexpected results.
8.7.8 Configure...
Configures the following options:
8.7.8.1 Automatic undo - If checked, automatically creates an
"undo buffer" when a new image is read.
This can also be done manually, by
selecting "Process...Backup image".
If you make a mistake when filtering or
adding text to the image, you can
restore the most recent backup from the
undo buffer by selecting "Process...Restore".
8.7.8.2 Spray factor - Controls the area affected by "fine
spray" and "diffuse spray" (in "Draw"
menu).
8.7.8.3 Cursor movement rate - Controls (a) distance moved by the mouse
cursor when the arrow keys are pressed,
and (b) the distance which an image moves
when you click one of the 4 arrows at
the top of the screen.
8.7.8.4 Color settings - Changes the default parameters used by TN-Image
when converting images.
Color reduction method - used when converting a color image to
pseudo-color (8 bit/pixel) modes.
Quantization - (Default) Calculates the optimal set of 256
colors to match the image as closely as
possible.
Fit current palette
- Calculates the closest match to the currently-
selected palette. This method can give a
smoother result than quantization or it can give
garbage, depending on how closely the colors in
the palette match the image.
If there are several images that need to be
converted to the same palette, the best procedure
is to convert the first one using quantization
then convert the rest by fitting to the current
palette.
8.7.8.5 Significant digits - Changes the number of significant digits to
display when using a floating-point number.
8.7.8.6 Crawl delay - Selects the speed of the "crawling" of the box
that indicates the selected area. A value of
4000 disables crawling. A lower value causes
faster crawling, but too low a value will cause
flicker on some displays, and slows down the
mouse cursor on slower machines.
8.7.8.7 Crawl density - Selects the number of dots in the "crawling box"
that indicates the selected area. A smaller
value makes the box easier to see, but slows
down the mouse cursor on slower machines.
8.7.8.8 Active color planes
- Selects which colors (red, green, or blue) are
capable of being modified. For example, if "red"
and "green" are un-checked, smoothing the image
would only smooth the blue component, while the
red and green components were unaffected. This
option only has an effect when TN-Image is
running in high-color or true color screen
modes (i.e., 15 to 32 bits/pixel).
8.8.0 Help menu
Displays the Help screen. Context-sensitive help is also available
for several topics by clicking on the "Help" button.
8.9.0 Miscellaneous features
Alt-E - Erase image
Erases the currently-selected image (after asking you).
Useful if memory somehow gets filled with images and there
is insufficient memory to open a window. This can sometimes
happen in a Windows DOS box but should not happen in DOS.
Alt-R - Rebuild screen display
If for some reason the display is incorrect, Alt-R will
cause it to be rebuilt.
F2 - Toggle Sketch mode on/off
8.9.1 Alt-T - Test video
Tests the maximum frame rate of your video system.
Here are some typical frame rates (fps) in DOS on a 80486 33MHz PC
with ISA:
Screen mode
Video card mode 100 101 103 105 107 111 112 115
xres 640 640 800 1024 1280 640 640 800
yres 400 480 600 768 1024 480 480 600
bpp 8 8 8 8 8 16 32 32
------------------- ---- ---- ---- ---- ---- ---- ---- ----
#9GXE64-2MB VRAM S3 - 7.69 4.54 4.34 3.33 2.63 2.50 1.00
ATI Expression Mach64 12.5 9.09 5.26 5.55 1.27 2.63 1.59 0.89
Kelvin 64 (Cirrus) 2MB 16.7 12.50 8.33 5.00 3.33 3.22 1.89 2.00
Tseng ET4000 8-bit* 4.3 3.57 2.22 1.61 - - - -
Trident 8900 1MB 10.0 8.33 4.34 - - - - -
Realtek 1MB RTG3106 8.3 6.66 4.00 2.85 - - - -
* = Card in bad shape
- = Unable to set mode
Speed is not the most important parameter, however. On a high-quality
monitor, cheaper cards may appear fuzzy or jittery or have weird-
looking fonts. PCI bus video cards are in general about 5-10 times
faster. Frame rates will be much lower in Unix X11 versions and
Windows versions (if one becomes available) of the program.
9.0.0 Windows and OS/2 compatibility
It is recommended to use the included PIF file (TNIMAGE.PIF) when
running TN-Image under Windows.
The suggested procedure is:
(1) Copy and unzip TN-Image in the desired location, e.g.,
C:\TNIMAGE.
(2) In Windows, Select "File...New program item"
(3) Set "Description" to "TN-Image".
(4) Set "Command line" to C:\TNIMAGE\TNIMAGE.PIF
(5) Set "Working directory" to C:\TNIMAGE
(6) Set "Shortcut Key" to "none"
(7) Leave "Run minimized" unchecked.
(8) Select "Change icon" and enter "C:\TNIMAGE\TNIMAGE.ICO"
(9) Click on "OK".
Virtual Memory
Because Windows takes over virtual memory, running TN-Image
under Windows will affect virtual memory usage. Before starting
TN-Image, make sure the amount of Virtual Memory selected in the
Windows Control Panel is greater than the amount of RAM in your
computer. Failure to do this can result in frequent "Out of memory"
errors. Windows' virtual memory is much slower than the VM built
into TN-Image. Hence, there is no particular advantage to running
TN-Image under Windows. Also, as with all applications, speed
under Windows will be markedly slower than in DOS.
A peculiarity of Windows is that if you have the wrong mouse
driver installed in Windows, you can lose control of the mouse when
you run a mouse-based DOS program such as TN-Image. If this
happens, run the "setup" program in Windows to ensure that
Windows is set up to use the mouse driver that is appropriate for
your mouse. For example, if you have a Logitech mouse, using the
Microsoft mouse driver may cause the mouse to become immobilized
when you return from TN-Image. Because Windows uses a different
mouse driver from DOS, the mouse may work under Windows but not
in a DOS box. If the mouse doesn't work right when running under
Windows, you almost certainly need a new (or different) mouse driver.
An alternative approach which sometimes works for some reason is to
change Windows from its default VGA screen mode to a 256 color mode.
Windows 3.1 also has an "unexpected feature" of sometimes not
redrawing its own screen when returning from DOS graphics programs
such as TN-Image. One solution is to "minimize" the Windows screen
after returning from TN-Image and then immediately "Restore" it. This
forces Windows to redraw its screen.
Computers with ATI Mach 32 cards have problems running TN-Image
in true-color mode from within a DOS box. In this case, the only
solution is to run TN-Image from DOS, or use TN-Image in an 8 bit/pixel
mode (e.g., mode 103). (See "Command-line options" above). Mach 64
cards are a little better (they can handle 16 bit/pixel modes, but
still can't handle 24 bit modes in a DOS box). Most other cards have
no problems.
For both OS/2 and Windows, TN-Image must be run in "full screen" mode.
For OS/2, it may be necessary to change the DOS box parameters to
get TN-Image to run properly. TN-Image may not run on all
OS/2 configurations, because it needs to access the hardware.
NOTE: NO TECHNICAL SUPPORT IS PROVIDED FOR TN-IMAGE RUNNING UNDER OS/2.
NOTE:
In a Windows DOS box, the virtual memory manager in TN-Image
sometimes gets confused if Windows is set up for a small amount
of virtual memory. This causes the "Free Memory" display to be
incorrect, and more importantly, allows you to completely fill up
memory with images, making it impossible to use the menus. If this
happens, you can still erase an image by clicking on the image you
want to erase and pressing Alt-E. We are trying to find a better
solution for this problem. In the meantime, it is recommended that
Window's virtual memory be set to a size greater than the amount
of RAM in your computer.
10.0.0 Changing Computers
If you experience problems after moving TN-Image to a different
computer, or after changing video cards, erase the file TNIMAGE.INI.
This file contains TN-Image's video mode selection, and may inhibit
automatic detection of the video chip in your new computer. TN-Image
will revise the file automatically if it detects an incompatibility.
11.0.0 Problems
Problem: Strange colors on screen or TN-Image only using top 1/12
or 1/7 of the screen.
Solution: Some other Super VGA programs and communication programs
(such as some versions of Carbon Copy) contain an "unexpected
feature" that results in the computer being left in a state that
prevents proper functioning of TN-Image with certain video cards.
The DOS shell program 1Dirplus and one HPLC data-acquisition
program also have a similar feature which can interfere with the
palette registers. If TN-Image suddenly begins to run incorrectly
after running one of these programs, reboot your computer and
start TN-Image again. This can also occur when running TN-Image
as a DOS box in OS/2. Change the DOS box parameters to correct
the problem.
Problem: Entire screen compressed into upper 1/7 of the screen.
Solution: (1) Try starting TN-Image with the command line:
TNIMAGE -OLDVESA
(2) If that doesn't work, you probably are using an outdated VESA
VBE TSR (Terminate-and-stay-resident program). Obtain a new version
from the video card manufacturer. Note that most new video cards
already have VESA BIOS built in, and don't need a TSR. Try running
TN-Image without it. If nothing works, contact the author for
assistance.
Problem: Lower part of screen flickering (upper 2/3 of screen is
okay, lower 1/3 is "snow" or "static".
Solution: This occurs when the video card reports to TN-Image that
it is OK to set the specified high-resolution screen mode, but in
fact the card has insufficient video RAM to handle it. This will
occur on certain Cirrus-based cards. To solve the problem, it is
necessary to install additional memory in your video card. Using
TN-Image when this problem occurs could result in a system crash.
Problem: Screen is completely white.
Solution: This occurs when using one of the "experimental" Tseng
modes, if the video card is unable to handle the specified screen
mode. Press Alt-X two or three times to return to DOS, then use
the "mode" command line option to run TN-Image in a different
resolution.
Problem: Multiple copies of Menu Bar.
Solution: This is usually caused by an old video card with VESA
1.0 BIOS. Start TN-Image again using the command line:
TNIMAGE -OLDVESA
This can also happen if the UNIVBE TSR is present.
UNIVBE must be removed in this case.
Problem: Printer prints part of image, then gives an error message
or goes into a "form feeding frenzy".
Solution: This can occur on laser printers if your printer has
insufficient internal memory to handle the image. You will have
to install additional printer memory, print a smaller image or
print at a lower resolution or dither size. Generally, ˜4 MB is
required to print a 8x10 inch page in black-and-white at 600 dpi.
Color printing requires 3 or 4 times as much. Unfortunately, there
is no way for TN-Image to test how much memory the printer has. For
some reason, printer manufacturers have also made it impossible
to print an image in small segments. This problem does not occur
on inkjet printers.
This will also occur if printing is attempted on a dot-matrix
printer.
Problem: Mouse gets "lost" when running TN-Image from a Windows
DOS box.
Solution: This occurs with some Microsoft and possibly other mouse
drivers. Exit Windows, and replace your mouse driver with a newer
version or with a Logitech mouse driver. Then use Windows' Setup
program to change to the new mouse. Alternatively, use Windows'
Setup program to change Windows' screen display to 256 colors
(It's not known why this helps).
Problem: Screen is not restored correctly after running TN-Image
from a Windows DOS box.
Solution: Install a different video driver in Windows using
Windows' Setup utility.
Problem: Mouse jumps around on the screen, or exhibits jerky
movement as if trapped in a grid.
Solution: Obtain a new mouse driver. This can usually be obtained
from a bulletin board or ftp site operated by the mouse manufacturer.
Alternatively, Logitech mouse drivers can work on many mice. Older
mouse drivers often have trouble in SVGA modes. Microsoft mouse
drivers are particularly prone to these sorts of troubles. Some
old SVGA cards, such as Realtek video cards, create difficulties
with the mouse, making it possible to reach only x and y coordinates
that are divisible by 4. In this case, the video card must be
replaced.
Problem: Screen is garbage when running TN-Image from a Windows
DOS box, even though there is lot of video RAM.
Solution: This is a problem in computers with ATI video cards in
Windows for Work Groups for some screen resolution modes.
Run TN-Image at a lower color depth by changing the "Command Line"
entry in Windows' "Properties" menu to:
C:\TNIMAGE\TNIMAGE.PIF -mode 103
Alternatively, run TN-Image from DOS.
Problem: Unusual behavior or display colors immediately after
upgrading from a previous version of TN-Image.
Solution: Delete the configuration file TNIMAGE.INI.
Problem: Message "Invalid image file" appears after transferring
an image file from a Unix or mainframe system.
Solution: The most common cause of this problem is the failure to
use "binary" mode when sending the image file over the network.
If you are using Kermit, give the command
set file type binary
before getting the image. If you are using ftp, give the command
binary
before getting the image. It is very difficult to fix an image file
that has been corrupted by sending it in text mode.
Problem: Loading or processing of images is slow.
Solutions:(1) Speed can be greatly increased by starting TN-Image in
a screen mode that has the same color depth as the images. Analyzing
24-bit color images in 8-bit mode, for example, will be slow because
the entire image projected to the screen has to be re-palettized every
time any operation changes one or more pixels.
(2). If your hard disk light goes on during an image processing
operation, this means TN-Image is paging out to disk. This can be
reduced by installing more memory in your computer.
(3). Speed can be approximately doubled by running TN-Image
from DOS instead of in Windows or by removing any expanded-memory
managers such as 386^Max or (especially) EMM386.
Problem: Palette rotation in startup screen is slow or jerky.
Solution: If you are running the Unix version, this can happen if
another copy of xtnimage is running, or if the mouse is moved
suddenly during startup. In the DOS version, this is usually
caused by a slow video card.
Problem: "Insufficient memory" message occurs even though "About the
program..." indicates there should be enough memory.
Solution: Turn "Automatic undo" option off. This will cut the storage
requirements in half. Also, a certain amount of memory is also
reserved by TN-Image for dialog boxes, etc. and is unavailable.
If this happens in Windows, you must increase the "Virtual Memory"
setting in Windows ("Control panel..386 Enhanced..Virtual memory.)".
Problem: Video card won't go into desired screen mode, even though
video card manual states that mode is supported.
Solution: (1) If ATI card: Run ATI's "Install" program again to verify
the specified video mode is activated. (2) Run TN-Image's diagnostics
by typing: tnimage -diag to determine the problem, which is usually
caused by insufficient RAM or a monitor limitation.
(3) Another possibility is that the computer was turned on before
turning on the power to the monitor. Some video cards only examine
the monitor type at power-up, will become confused if the monitor
is off during a cold boot-up, and refuse to set high-resolution modes.
Problem: Monitor makes a buzzing sound and fails to sync on startup
(causing jagged diagonal lines on the screen).
Solution: Turn the monitor off immediately and press Alt-X several
times to stop the program. Restart TN-Image using a lower screen mode.
This problem could occur if your video card reports that it is safe to
set a given screen mode when in fact it is not safe. Only one card has
been found so far that does this, when setting a 1280x1024 resolution
mode. Prolonged operation in this condition could harm your monitor.
Problem: A grayscale image appears completely black or white.
Solution: This is usually caused by the automatic grayscale mapping
feature misinterpreting the upper and lower gray levels of your image.
If the image is being read as "raw bytes", make sure you have selected
the correct number of bits/pixel, x size and y size. If the y size
you entered is too large, TN-Image may read beyond the end of the
image and incorrectly estimate the maximum and minimum levels.
To correct this, select "Color...Set palette...Grayscale mapping"
and change the maximum and minimum values to correspond to those in
the image. (For example, if the image is known to be 12 bits deep,
the maximum should be approximately 2^12 or 4096.)
Problem: "Mouse required" message occurs when starting TN-Image,
even though Windows runs OK with the mouse.
Solution: Windows has its own separate mouse driver. It is still
necessary to load a mouse driver for DOS applications. Run the
program "mouse.com" that came with your mouse.
Problem: When typing text on the screen, it comes out in the wrong
color.
Solution: The available colors are determined by the color depth,
the gray scale mapping parameters and palette (if present) of the
image you are typing on. For example, if an 8-bit image with a
particular palette is loaded, you can only add colors that exist
in that palette, even if TN-Image is in a 24-bit color mode. This
prevents you from accidentally adding a color which is impossible
to save with the image. If all else fails, press Alt-R to rebuild
the screen display.
Problem: The message "Converting from 24 to 8 bits/pixel" stays on
the screen for a long time.
Solution: Select "Color...Color settings" and make sure "Color reduction
method" is set to "Quantization" and not "Fit current palette" which
can be slow.
Problem: When reading color images, the colors are wrong, or it takes
a long time.
Solution: Select "Color...Color settings" and make sure "Color reduction
method" is set to "Quantization" and not "Fit current palette" which
may give incorrect colors.
Problem: After reading a GIF file or a color image, subsequent images
in other formats appear to be "garbage".
Solution: This only occurs in 8-bit/pixel screen modes. When an image
that does not have its own palette is loaded, the palette is not
automatically changed. If the current palette is discontinuous, the
new image may appear to contain garbage (of course, it is not really
garbage). Simply click anywhere on the background, or use the "Change
palette" menu option to change to a continuous palette.
Problem: Medical grayscale images appear grainy or posterized; or
appear as strange shades of blue instead of gray.
Solution: The wrong target platform may have been selected. Select
"File...Create custom format" and change the "Target platform" and/or
"Bytes to skip" for the specified format until a smooth image is
obtained.
If you are using the Shareware version, you will need to read the
image as a "raw" file and tweak the image parameters manually.
Problem: Deconvolution result is completely black, completely white,
or garbage.
Solution: This can be caused by (a) using an inappropriate point
spread function, (b) using a point spread function that has zero or
near-zero intensities at one or more frequencies, or (c) wrap-around
effects. Sometimes, adding noise to the point spread function will
increase the intensity at the missing frequencies and solve the problem.
Alternatively, try a less ambitious point spread function. Try dumping
the FFT data to disk and reading it with a text editor. If the numbers
are all "-nan"'s, this is a sign that the intensities were too low
and a different psf must be used. Some images simply don't work well
with deconvolution.
Problem: "Fill Region" was selected, but nothing happened when mouse
was clicked on the region to fill.
Solution: Make sure the area being filled is darker (lower intensity
value) than BOTH the Max. Border Color and the Min. Border Color.
Filling will stop whenever any color between these two values is
encountered.
Problem: Mouse cursor moving by itself.
Solution: Make sure mouse is on a level surface.
Problem: "out-of-memory" problems running TN-Image in a Windows DOS box.
Solution: This is usually caused by an incorrect setting in
your virtual memory. Try the following procedure to fix it:
1. Click on Windows Control Panel
2. Click on "386 Enhanced"
3. Click on "Virtual Memory"
4. If the size of the Virtual memory is less than the amount of
RAM in your computer, problems may occur. Change the amount of
Virtual Memory to the maximum recommended by Windows; or exit
Windows and run TN-Image from DOS.
Problem: Spots floating across screen, or jagged flickering lines.
Solution: You are working too hard, go lie down.
12.0.0 Limitations and known bugs
In the Unix version, the width or height of the viewable area cannot
be made larger than the width or height of the screen. Color sharing
with other applications could be friendlier in the Unix version.
When making the main window smaller in the Unix version, the actual
resizing is not done until the window is re-exposed.
When an FFT is present, it is impossible to flip the image.
13.0.0 Error messages
All versions
------------
Insufficient conventional memory to run program
Insufficient extended memory to run program
These errors usually mean an extended memory manager is
required but not present. The simplest solution is to find
the file HIMEM.SYS (which comes with DOS) and install it
in your CONFIG.SYS file, e.g., add the line
C:\DOS\HIMEM.SYS
to CONFIG.SYS (make sure HIMEM.SYS is in the DOS
directory before doing this).
Also, check to see if you have an expanded memory
manager installed. These programs sometimes block access
to portions of video memory or high memory.
Not enough memory
Insufficient memory to perform the requested action (see
"Operating under low-memory conditions" above). This message
should not occur in the Registered version of TN-Image,
unless there is insufficient disk space.
Insufficient memory to convert to 8 bits/pixel
A color map table could not be generated for the image. When
this happens, the image cannot be converted to the screen
resolution, leaving "garbage" on the screen. Try changing
`color reduction method' to "fit current palette". This
method uses less memory. Alternatively, start TN-Image in a
color mode and try again. This message should not occur in
the Registered version of TN-Image, unless there is insufficient
disk space.
Internal error [...]
Contact author for assistance, specifying the exact message
and the circumstances under which it occurred.
Can't compact free space
This can occur when you try to unload an extremely large image.
The only consequence is that the maximum amount of free
memory could not be recovered. Usually, erasing the image
again will free up the space.
Too many images
The limit of 512 images (or 2 images for the Shareware version)
was exceeded while attempting to read an image from disk
or create a new image. Don't forget that a new image is also
created when you try to rotate or resize an image or carry out
an FFT.
Image was not backed up
This only occurs when you select "Restore" when
the "Auto undo buffer" option was un-checked, so that new
images were not automatically backed up. Although un-checking
`auto undo buffer' creates more free memory, it means that it
will be impossible to undo any changes by selecting "restore".
Function not available in shareware version
The function is only available in the Registered version of
the program.
Function not available
The function has not yet been implemented. Contact the author
for availability dates.
Error - mixed expand and shrink operations
You cannot shrink an image in one dimension and enlarge it
in another simultaneously, it must be done in two passes.
Error: Bad OD table, Turn pixel compensation off
Densitometry could not be performed because part or all of
the selected region was on an image whose O.D. table mapped
two or more pixel intensity values to the same O.D. You must
either repair the OD table, or select "No pixel compensation".