2.3 FWB-FSD Dither
FWB stands for “Four-Way Block” and FSD stands
for Floyd-Steinberg Dither. FSD is a effective
dithering error diffusion algirithm. In an error
diffusion algorithm, each pixel in the original image
will disffuse its quatization error to its neigboring
pixels. It was shown that FWB-FSD is a better
algorithm on mosaic art images and other types of
images that require enlargement of pixels (Lin and
Wang, 2011). In particular, FWB divides the input
image into blocks of an equal size with each block
consisting of four sub-blocks such that the size of
each sub-block is suitable for an underlying FSD
error-diffusion algorithm. Scanning blocks from left
to right and from top to bottom, for each block being
scanned, FWB starts from the center of the block
and diffuses errors along four directions on each
sub-block.
The quantization error of each pixel, which is the
difference between the RGB value of the pixel in the
input image and the closest color in the limited color
palette, will be distributed to its neighbour pixels by
the coefficient error diffusion matrix when system is
scanning the sub block. FWB uses the coefficient
matrix developed from Floyd and Steinberg
dithering (FSD). The FSD method diffuses a pixel’s
quantization error to its four neighbour pixels with
the coefficient error diffusion matrix shown in (1),
where x is the pixel being processing.
×
000
07
153
(1)
3 MOSAIC IMAGE EDITOR
We have developed a useful Web tool to allow users
to modify mosaic images with the effect of “what
you see is what you get” efficiently. This tool is
based on AJAX, XML, Web Service and XQuery
technologies.
AJAX (Asynchronous JavaScript and XML) is a
powerful Web development mode for browser-based
Web applications. Technologies that form the AJAX
mode, such as JavaScript, HTTP, and XHTML, have
each been widely used and well known. AJAX
combines these technologies to allow Web pages to
retrieve small amounts of data from the server
without having to reload the entire page. This
capability makes it possible to update Web pages
between the server and the client smoothly and
interactively (Lei and Duan, 2007).
For raster images, Languages like XHTML
which does not have such a structural feature in their
environment. Instead, XML provides image
elements’ means such as pixel and RGB for the
incorporation of raster images in text-based files
(Hur, Lee and Kim, 2006). In the TMA, we
developed the XML (see Figure 4 (b)) to present
mosaic image which is raster image and presented
by XHTML to display the mosaic image. Converting
a raster formatted image into XML enables the user
to utilize the information residing in the image and
select, read and manipulate the parts of the XML file
or the file as a whole in a number of ways in
accordance with the pixel and its color space
(Antoniou and Tsoulos, 2006). This section
elaborates on the technological environment, which
can be utilized for the XML encoding of raster
mosaic images and the transmitting information to
the existing datasets using Ajax and web service
methods. In the TMA system, mosaic images,
formed by the XML (see Figure 4 (b)) and saved in
the database, are useful for editing, researching,
retrieving and copyright checking the copyright.
XQuery, an XML query language, a query
language that uses the structure of XML intelligently
can express queries across all these kinds of data,
whether physically stored in XML or viewed as
XML via middleware. The XQuery is designed to be
broadly applicable across many types of XML data
sources (W3C, 2010). Mosaic image editor
developed the XQuery to access the mosaic image in
the image database and return the XML data of
mosaic image.
The mosaic image editor, one of application in
the TMA system, allowing users to modify mosaic
image in the browser (see Figure 3), retrieved the
mosaic image which XML formatted in the database
by the XQuery. In Figure 3, there are three images
are displayed. Image (a) represents the current
mosaic art image, formed as a table of XHTML and
CSS that retrieves the RGB values from the image
database. The user is allowed to choose the colors in
the color palette (shown in Figure (c)) to modify
each cell’s color in Figure (a). Simultaneously, the
icon in Figure (b) will be changed according to the
modification in the biggest image to get the overall
image. When the user saves the modified mosaic
image, the system will send the modified coordinate
values and the RGB values to the server. AJAX and
Web Service are used to store the image into
database.
A WEB APPLICATION FOR MAKING MOSAIC ART IMAGES
643