home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
GRAPHICS
/
mgif.lzh
/
GIF
/
mgif.man
< prev
next >
Wrap
Text File
|
1992-01-13
|
8KB
|
307 lines
.\" @(#) mgif 3.2 91/6/3 rosenkra
.\" by rosenkra@convex.com (Bill Rosenkranz)
.\"
.TH MGIF 1 LOCAL "Version 3.2" "3 June 1991"
.SH NAME
mgif \- display a GIF image in monochrome
.SH SYNOPSIS
.\" mgif [ -i ] [ -v ] [ -N ] file ...
.B mgif
[
.B \-i
] [
.B \-v
] [
.B \-N
]
.IR file ...
.SH DESCRIPTION
.B Mgif
displays color
.SM GIF
images on a monochrome ST display.
.SM GIF
files carry the extensions \*(lq.gif\*(rq and are compressed using
LZW codes.
It uses Floyd-Steinberg dithering to simulate color.
In addition, this new version implements \*(lqflicker\*(rq palettes to
simulate grayscale on a monochrome screen.
All things considered, it does a decent job.
.PP
.B Mgif
now also contains numerous image processing functions to enhance images.
Included are:
.sp
.nf
Histogram equalization
Contrast stretching
Blurring
Brightening (or darkening)
Histogram plot
Enlarge/reduce
Inversion (negation with threshold)
Log scaling
Thresholding
Median filtering
.fi
.PP
.B Mgif
allows each image processing function to be cummulative or each
operation can be independent.
.B Mgif
is interactive (not a
.SM GEM
program) and prompts for commands.
It also has online help.
.SH OPTIONS
The following command line options are recognized:
.IP "\fB\-i\fR"
Inquire about the file but do not display it.
Output contains information like image size, number of bits per pixel,
and whether or not the image is interlaced or sequential.
.IP "\fB\-v\fR"
Verbose output.
.IP "\fB\-N\fR"
Use the classic
.SM NTSC
equation for computing luminescense from
.SM RGB
values, that is:
.sp
.RS
lum = 0.299 R + 0.587 G + 0.114 B
.RE
.sp
Otherwise the values are unweighted.
This option only makes sense for files with color maps in which the
entry for each color uses different values for red, green, and blue.
Note that the actual equation used is:
.sp
.RS
lum = 0.30 R + 0.59 G + 0.11 B
.RE
.sp
which is close enough.
Also note that
.SM NTSC
luminescense is a global option and must be set on program entry.
.IP "\fIfile\fR"
One or more
.SM GIF
files.
.SH "INTERACTIVE COMMANDS"
The following commands are available at the prompt:
.IP "\fB?\fR"
help
.sp
Clears the screen and prints a brief summary of commands.
.IP "\fBq\fR"
quit (next image)
.sp
Quit does not exit the program.
It just moves to the next image from the command line.
.IP "\fBESC\fR"
exit program
.sp
Cleans up and exits.
.IP "\fBSPACE\fR"
draw image
.sp
The current image, either original or new, is drawn (or redrawn).
.IP "\fBhi\fR"
histogram
.sp
Plots the histogram of the original or new image.
The histogram is based on intensity only.
Older versions of the program displayed
.SM RGB
histograms as well.
That option was dropped, though it was sometimes useful.
Note that if
.B o
is toggled for original image, you should toggle
.B o
again to plot a histogram of a transformed image, then toggle back
to work on the original.
.IP "\fBo\fR"
original/new image
.sp
This toggles two sorts of behavior: 1) all transformations take place
on the
.I original
image and are not cummulative, 2) all transformations
take place on the
.I new
(last) image and are cummulative.
.IP "\fBn\fR"
noise
.sp
Adds noise not to the image but to the \*(lqflicker\*(rq process itself.
Can help in images which have artificial banding as a result of the
dithering process.
You are asked for a value,
which if 0, turns off noise addition.
Otherwise, it is a percentage (0 to 100).
Each time
.B o
is toggled, noise is reset to 0 (i.e. off).
.IP "\fBg\fR"
Laplace filter
.sp
This, like noise, is not applied to the image itself but rather in
the flicker process.
It helps to define hard edges in images and implements a Laplace filter.
A quantity,
.BR Beta ,
is required.
Use integers (1, 2, etc.) for this value.
A value of 1 corresponds to Beta of 0.25,
a value of 2 corresponds to Beta of 0.50, etc.
A value of 0 turns off Laplace filtering.
Each time
.B o
is toggled, Beta is reset to 0 (i.e. Laplace filtering off).
.IP "\fBe\fR"
enlarge
.sp
Enlarges images by 2x (only).
.IP "\fBs\fR"
shrink
.sp
Reduces images by 2x (only).
Makes them half size in height and width.
.IP "\fBhe\fR"
histogram equalization
.sp
Histogram equalization attempts to smooth out images with skewed or narrow
histograms.
A histogram is a graph showing the relative number of pixels with each
possible intensity value.
The practical use is to make images more uniform in contrast by
making the histogram more uniform and hence representing all intensities
as equally as possible.
.IP "\fBi\fR"
inverse (negation)
.sp
Invert an image, i.e. make low intensity pixels bright and visa versa.
Inversion is implemented here more generally.
A threshold is needed.
If it is 0, the entire image is inverted.
If it is a negative value between 0 and -255, only pixels
.I below
that level are inverted.
If it is a positive value between 0 and 255, only pixels
.I above
that level are inverted.
.IP "\fBl\fR"
log scaling
.sp
Application of log scaling helps some images.
It more often will sort of \*(lqsolarize\*(rq images.
.IP "\fBt\fR"
threshold (black & white)
.sp
This process makes all pixels above a given threshold intensity
white and all below the threshold black.
It is useful in producing line art.
.IP "\fBc\fR"
contrast expansion
.sp
Attempts to expand the contrast of an image to cover the entire range
of 256 allowable grayscales.
Somewhat similar to histogram equalization but it does not redistribute
actual pixels.
You are asked for a threshold which is a pixel count.
This determines the lowest and highest intensities, based on the
histogram, which are to be stretched.
.IP "\fBbr\fR"
brighten (or darken)
.sp
Here a constant intensity is added (or subtracted) from every pixel.
A negative number causes image darkening and a positive number causes
image brightening.
Pixels which would otherwise go less than 0 or greater than 255 are limited
to these values, respectively.
.IP "\fBbl\fR"
blur
.sp
Blurring an image can also help contrast, though at the expense of loss
of detail.
Here a 3x3 neighborhood is used.
Often in practice a 5x5 neighborhood is used, but that tends to take a
relatively long time.
.IP "\fBm\fR"
median filter
.sp
Median filtering can remove noise from an image.
Here a 3x3 neighborhood is used with the median value of each of the 9
pixels replacing the pixel of interest.
This is done in place so that the next pixel examined within the row or the
next row will see pixels already filtered.
.IP "\fBv\fR"
convolution filters
.sp
Apply one of a number of 3x3 convolutions to an image.
Choose one of the built\-in filters (number greater than 0) or enter 0
for user defined.
In the latter case, you enter the 9 elements of the convolution kernel along
with a flag if there will be a multiplier (or divisor).
Then enter that scaling factor.
All quantities are to be integers.
.SH FILES
.nf
*.gif GIF image files
.fi
.SH "SEE ALSO"
gif(5)
.br
Gonzalez and Wintz, \fIDigital Image Processing\fR.
.br
Lindley, \fIPractical Image Processing In C\fR.
.br
Burger and Gillies, \fIInteractive Computer Graphics\fR.
.SH DIAGNOSTICS
Various warnings attempting to isolate corrupted files.
The usual messages about errors openning files, etc.
If an error occurs during a processing function, the prompt line
will indicate the error.
.SH NOTES
Source code has standalone versions (i.e. single entry point) for
both reading
.SM GIF
files and displaying grayscale bitmaps with flicker.
.SH BUGS
Handles images up to 400,000 bytes (hardwired) or 640x600 (or any other
combination totaling 400,000).
It needs dynamic memory but I generally stay away from
.SM GEMDOS
.IR Malloc (2),
prefering libc
.IR malloc (3)
(i.e. off stack).
.PP
.SM GIF
decoding is slow and could be faster.
Some of the area processes (blur, etc.) could also be faster.
.PP
Log scaling needs logarithms but I did not want to use floating point
so I get a crude (two significant digit) base 2 log.
.SH TODO
More than I wish to consider, but here is the short list:
.sp
.nf
\(bu Output file of some sort
\(bu Zoom and pan
\(bu Rotate, mirror, etc.
.fi
.SH AUTHOR
.nf
Bill Rosenkranz (rosenkra@convex.com)
.br
Flicker adopted from code sent to me by Klaus Pedersen (micro@imada.dk)
.fi
.SH VERSION
mgif 3.2 91/6/3 rosenkra