home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
m
/
mask
/
!Mask
/
!Help
< prev
next >
Wrap
Text File
|
1993-09-17
|
19KB
|
418 lines
Version=1.11 You may copy this program for non-commercial reasons only.
summary:
!Mask is an application which allows you select certain items of a picture.
For example you can isolate yellow text from a blue-ish picture. The program
also offers some image processing possibilities like photomorphing.
Input files are always clear or sprite files, output files are always clear
files. In the clear format you have a 24 bit palette or full 24 bit color.
You can translate clears<>sprites using !Translator, see below.
Main features:
1)Selecting & isolating objects in an image, based on its color, hue, etc.
2)Erasing objects in an image
3)Changing the color of objects in an image
4)Morphing one picture gradually into another
*********************************GETTING STARTED***************************
Give the program as much memory as possible, but leave enough screenmemory.
Press the select button over an object in the top-left window. For example
the M of 'megadeth'. Than press menu in the top-left window or press it
above the vertical bar. A mask will be made in about 0.6 (arm2) or
0.15 (arm3) seconds.
*********************************MASKING***********************************
Making masks from r,b,g values in the original image:
grey:
Compares grey values of pixels and target pixel.
rule: (r+g+b)-(Tr+Tg+Tb)<d
rgb:
Compares distance of the rgb vector of a pixel and target pixel.
rule: (r-Tr)²+(g-Tg)²+(b-Tb)²<d²
color:
Compares 'color' of pixels. This is the best choice in most cases.
Note that masking this way will also select black (rgb=0,0,0) and
possibly other dark colors. This option is of no use to monochrome
images.
rule: v=r+g+b:t=Tr+Tg+Tb:(r*t-Tr*v)²+(g*t-Tg*v)²+(b*t-Tb*v)²<d²*v²*t²
edge:
Tries to find edges in the picture. Rather slow.
rule: Er²+Eg²+Eb²>d² ,with Er,Eg,Eb the edginess of a point, defined
by sobelX²+sobelY².
hue:
Compares color of pixels, but in another way than 'color'.
The hue of a pixel is not depending on its brightness, nor its
'whiteness'. So it may do well in overexposed images.
rule:(h(target)-h(pixel))mod (2*PI)<d , with h(r,g,b)=
arctan2(r-2/3*sqr(3)*(g+b) , 1/2*g-1/2*b). This is not (and probably
will never be) implemented for full 24 bit files.
(Tr,Tg,Tb) is the color of the target (selected) pixel.
You can activate the mask routines by pressing menu in the top-left window,
or elsewere, or by selecting a new mask-button.
You can change the value of 'd' by dragging the bar in the middle of the
screen. Dragging with the menu-button will start calculation immediately.
To set the target pixel, use the select-button in the top-left window.
You can make a rectangular mask by setting a rectangle with the adjust-
button in the top-left window.
You can edit pixels by using menu (setting) and adjust (removing) in the
down-left window.
Selecting groups:
By clicking select on a 4-connected group in the down-left window will
select this group as the current mask.
Shift-clicking select on a group that is not masked out, will remove
that group from the current mask.
Shift-clicking select on a masked out group, will add that group to the
current mask.
N.b. both groups that are in and out the mask are considered to be
groups.
*********************************MASK PROCESSING***************************
binary operations:
not :z=not x
and :z=x and y
eor :z=x eor y
or :z=x or y
andnot:z=x and not y
= :z=x
0 :z=0
1 :z=1
where z is the current mask, (yellow frame) and x and y have to be
selected, and may be equal to z.
seed x:
selects all 4-connected objects in the current mask, that are pointed
at by the pixels in mask x. There is a maximum of pixels that will be
used as seed. This operation may fail if there is not enough memory.
large x:
select all 4-connected objects in the current mask, that are thicker
(in both directions) than x.
noise x:
removes noise (pixels with less than x 8-connected neighbours)
if x=8 then this is equivalent to erodating the image.
Setting x to 3 removes all thin lines in the image.
dilation x:
adds pixel if it has at least x 8-connected neighbours.
nb. dilation(image,x)=not(noise(not image,9-x))
*********************************INPUT/OUTPUT******************************
loading:
Enter a filename or enter return to abort loading.
load options:
pic load a clear or sprite file as the main picture. All 2, 4, 16
and 256 color sprites are supported, including 256 grey-level
sprites. If no palette is given, the desktop colors are used
instead. If a sprite has a mask, this will be loaded and used
as the currently selected mask. If there is not enough memory
for the image, it can happen that the program has to quit.
Loading 2,4 and 16 color sprites may be slow.
mask load a binary clear file as the current mask. The file has to
have the same size as the main picture.
back replaces the masked out part of the main picture by the file
loaded. The loaded file must have the same size (x & y) as
the current picture. Currently this option works only if both
the current and loaded picture are full 24 bit images.
saving:
Enter a filename or enter return to abort saving.
save options:
pic save whole picture (masked). Masked out parts of the picture
are replaced by the nearest color in the images palette.
smpic make the picture as small as possible and than save it.
mask save the current mask as a binary clear file.
*********************************IMAGE PROCESSING**************************
Image processing options:
Map:
Loads a color transformation file, and than transforms the colors,
according to this file. You can make the file yourself, by editing
!Mask.GenMap
options: entering return will give you the default file:<Mask$Dir>.Maps.
Mymap
entering 'last' will give you the last used map
or enter the name of the file.
InvM:
Inverts the color of the part of the image that is in the mask.
⇦⇨:
Flips image in y-axes.
⇩⇧:
Flips image in x-axes.
24b:
Converts paletted images to full 24 bit images. This can be useful as
some options in this program only work with 24 bit images. This operation
may destroy some masks, without warning. The masks will be compressed and
stored in the scrap-directory.
Erase:
Removes the selected part from the image. The removed part of the
image is filled up with colors, totally depending on the edge of the
mask. In some cases it is possible to remove something out of the
image without leaving visible traces. The method used for filling
up the image is Gauss-Seidel iteration. Currently a slow implementation
is used for which execution time is about equal to c*P² , with c
some constant depending on your machine and the shape of the mask and
P is the number of pixels involved. The calculations take place in the
smallest rectangle, surrounding the mask. If you get the message:'doing
800 iterations', the calculation will take about 3 minutes on an arm3.
So make the mask as small as possible! This works only for 24 bit
images.
Col:
Changes the color of the pixels in the mask. The resulting image will
be monochrome. Options:
C :the new color will be the some as that of the currently selected
pixel
N :enter values for red, green and blue. The values must a positive
number (like 0.71 or 4000)
A :Abort operation
Grey:
Changes the grey-value of the pixels in the mask by a specified factor.
Gamma:
Performs gamma-correction on the pixels in the mask. Gamma < 1 makes
the picture darker, gamma >1 makes it lighter. Darker parts are affected
more than light parts. Rule: dest=source^(1/gamma). It can also be
used on overexposed images: First