Template Image Editor allows to edit template images and define
comparison parameters. It is available from any GUI component
which deals with image comparison, such as the CompareTo,
Screenshot, and Waitfor match windows.
The editor operates in two modes depending on the image comparison
method (algorithm) selected in the owning component:
Basic Mode allows to
view, inspect and crop the template image.
Mode provides additional functionality related to pixel
transparency supported by the image search algorithm.
2. Basic Mode
The template editor displays in basic mode whenever the selected
comparison algorithm doesn't support transparency, such as for
the default histogram
one. It basically allows just to crop the image. The window then
consists of the following elements:
Image view displays
current template image on a contrast chessboard-like background.
define a crop rectangle (such as the one in the picture) drag
in the view. The selected rectangle can be further on adjusted
dragging its dashed side lines or corners.
Close button closes the image editor and saves the crop
rectangle (if defined) as well as any image comparison
defined through transparency operations (if available). These
are stored just to the memory and they are not saved to the
and/or the test script unless the window owning the editor is
with the OK button.
Selection button resets (cancels) the selected
and Zoom Out buttons
magnify the image. Zooming functions apply just to the image
they do not have any effect on the resulting template image. The
in function is available only as long as the displayed image
height are smaller than 1000 pixels. This limitation is applied
prevent Java from running out of memory.
label displays information about the image pixel under
current mouse pointer position. It displays its coordinates and
(both visually as well as in form of HTML style RGB notation).
appends information on whether the pixel is fully opaque (alpha
component is equal to 255) or transparent
(alpha is between 0 and 254).
The red cross indicates the image click point. It represents the
best location for an eventual mouse action such as a click,
release or drag. The point defaults to the image center but it
customized to any location inside or even outside the template
image rectangle. See the Image
Data documentation for details. To move the click point
drag it using the mouse.
3. Advanced Mode With Transparency
Advanced mode supports image search improvements delivered in
T-Plan Robot Enterprise 2.1. The new functionality is intended to support
search for graphic objects on various backgounds without having to
the template image with third party editors in order to reduce
comparable pixels through transparency. The image search algorithm
optional now supports an image filter which makes background color
the template image transparent and thus forces the search logic to
them. This feature is provided through three parameters:
(represented by the Ignore
background check box in the GUI) switches on/off
to filter out the background color during image search. It can
only to template images which do not contain any transparent or
created by third party image editors (such as Gimp). When this
is on (removebg=true),
algorithm internally applies an image filter to the template
which makes all pixels equal to the specified color
and all reasonably similar pixels translucent (partially
Transparent pixels are then ignored during the image search
process while translucent pixels may be compared up to the limit
specified by the minalpha
parameter (see below).
parameter (Custom background
field) allows to define a custom background color. If this
not specified, the color is determined automatically from the
first image pixel (top left image corner of the selected
rectangle or image). This parameter is enabled
and makes sense only when background filter is on (removebg=true).
parameter (Minimum alpha
sets translucency tolerance. Alpha is a pixel color component
(transparent) and 255 (opaque) which defines the level of pixel
default value of 255 instructs the search algorithm to compare
fully opaque pixels and ignore all transparent or translucent
ones. Values lower than 255 will make the algorithm to compare
translucent pixels with the alpha component equal to or greater
than the specified limit.
The parameter may be applied to images filtered
through the removebg
as well as to images with already existing transparency (for
images made transparent through Gimp or other image editor). The
minimum alpha parameter is intended to solve situations where
background color filter makes too many pixels or even all of
transparent or translucent. This leaves the search algorithm
just against a
small number of opaque pixels which usually leads to unexpected
results. As lowering the alpha limit increases number of
pixels, it may be used to improve accuracy of the image search
algorithm. Be however aware that as comparison of translucent
pixels is based on color similarity, it has significalntly
performance than the classic image search and extremely low
minimum alpha may produce unexpected match results.
Setting of these three parameters is supported by the template
as follows. Be aware that the transparency defined in the editor is
never physically written to the image file and it gets saved just in
form of the image search parameters into the test script.
Background toggle button switches on/off removal of
image background. When the button is on, the image view displays
filtered image containing just those pixels which are comparable
(meaning either opaque or with alpha equal to or greater than
to select custom transparent color. When the button is on, the
view temporarily switches to opaque mode and lets the user click
the image to select the new transparent color.
Limit lowers the minimum alpha. When this buton is
clicked on, it lowers the alpha limit to the next lower level
at least one pixel with the given alpha value. This makes the
pixels) comparable by the image search algorithm. The Increase Translucency Limit
provides reverse functionality and raises
the minimum alpha to the next
upper alpha value. Selecting this button removes
comparable pixels with the specified alpha component from the
The button is enabled only when the minalpha
parameter is lower than
pixel label provides in this mode extended information
actual pixel. It may display one of three state suffices:
the pixel is opaque and is always compared (alpha=255),
shows that the pixel is translucent and its alpha value
current minimum alpha limit (and thus it is accepted by the
search as comparable),
means that the pixel is either fully transparent or
alpha value below the limit
and it will be ignored by image search.
Details component displays template image summary. It
image size and the crop rectangle (if defined), status and
the transparency parameters and summary of comparable pixels. It
recommends a minimum pass rate calculated from the ratio of
pixels with an added safety marging of 10 pixels.
view acts a bit different in the advanced mode. As it
only comparable pixels, the view may differ from how the same
gets displayed in a web browser or any other third party image
This applies mainly to images which already contain