[HOME][CONTENTS][DOWNLOAD][PREV][NEXT]


IMAGE DISPLAY WITH GIMG


Masking. Masking is an important techique in advanced graphic user interface design. Masked objects are basic components in object oriented image ANIMATION. A significant feature of a gimg is the capability of multi-layer masking. A gimg directly supports four layers of masks, i.e., a mask defined by an image file, a mask created from the image data channels, a mask created from geometric objects and a frame created from geometric objects. A final mask is a result of a Boolean AND operation of all the four layers of masks. 

A gimg creates, defines, and manipulates masks by both options and commands. Once masks are defined or created, they can be turned on or turned off, as well as to be made opaque or transparent. An opaque mask can be further colored with a gimg option -background, and a transparent mask allows a viewer to see through the masked areas. The options for mask configuration are -maskfile, -maskimgband and -maskclass. These options define a mask from an existing image file. The option -maskon turns on/off a mask, and the option -maskopaque configures the mask to be either opaque or transparent. In addition, a multi-layer mask can be created by gimg commands with a general syntax of image_of_gimg mask op ?options?. A multi-layer mask consists of a bitmap created from the image in display, and/or geometric objects defined by rectangles, ovals, and polygons. A multi-layer mask can be either created or cleared by an operator specified by op, which can be either clear, delete, data, clip or frame

A unique layer in a multi-layer mask is frame. Like a regular mask layer, a frame defines a geometric region where an image can be displayed. A difference is that a frame can be created to be either static or dynamic. A static frame does not change with gimg’s configurations such as -mx, -my, -rotate, -xflip and -yflip. A dynamic frame may be magnified, reduced, flipped and rotated with the displayed image. In addition, a frame is always transparent to areas out of the frame while other layers of a mask can be configured to be either transparent or opaque. Layers of a mask except for a frame are always of dynamic, i.e., they can be magnified, reduced, flipped and rotated with the image in display. 

Images a, b, c and d at the right side demonstrate the process of creating masked images using a polygon. Image a at top is a raw image showing a space shuttle. It was cropped from the original shuttle image archive KSC-97EC-1209. Image b shows a red polygon of the shuttle outline on a black/white shuttle bitmap. In order to create a masked shuttle image, the outline polygon was drawn first. The black/white bitmap mask was then created with the command gimg_of_shuttle mask clip pl {x0 y0 ...}, assuming the gimg displaying the raw shuttle image is gimg_of_shuttle. In the command, pl means a polygon data type, {x0 y0 ...} is a list of x and y coordinates of the polygon. Below image b is image c showing a shuttle image with an opaque mask of blue color. The correspondent configuration is -maskopaq1 -backgroundblue. Image d is a shuttle image with a transparent mask. The correspondent configuration is -maskopaq 0. 

Images e and f at the right side demonstrate the process of creating a masked image using the spectral features of the data set. Image e shows a cloud in a sky. It was cropped from the original shuttle image archive KSC-95EC-0963. Image f shows a black/white bitmap mask for the cloud. The command to create the mask bitmap is gimg_of_cloud mask data{off 0-255} {on 220-255}, assuming the gimg displaying the raw cloud image is gimg_of_cloud. Image g shows the cloud with a transparent mask that effectively removes the sky from the image background. 

[HOME][CONTENTS][DOWNLOAD]


a. raw image

b. shuttle masks 

c. opaque masking


d. transparent masking


e. raw cloud image


f. cloud mask


g. masked cloud