GIF/PNG Rasterizer ReaderWriter
Licensing options for this format begin with FME Professional Edition.
The GIF/PNG Rasterizer Writer allows FME to be used to translate vector data on-the-fly for display in web browsers.
Client-side image maps may also be produced to provide clickable, intelligent images in the web browser. It also enables the FME to be used as a powerful gateway between vector geographic data and raster-based Geographical Information Systems (GIS).
In addition to GIF images, the GIF writer can be used to generate Portable Network Graphics (PNG) images.
PNG replaces the use of GIF in many situations. Support for PNG is discussed below, in the section entitled PNG Support. In general, comments regarding the GIF writer also apply to the PNG writer, as they are both in fact the same module.
The FME GIF writer does not use the patented Lempel-Ziv Welch (LZW) compression algorithm; therefore, the GIF images it produces are roughly 10 times larger than the corresponding PNG image.
Note: This writer only supports vector input data. To write GIF and PNG files from raster input data, see the GIF Reader/Writer and PNG Reader/Writer chapters.
Overview
GIF files are compressed raster image files. CompuServe designed the format in 1987 as an efficient means of transporting images across low speed networks. The format is one of several standard image formats supported by most world wide web browsers.
GIF images consist of eight bit pixels. The value of each pixel is an index to a color table, having eight bits each of red, green and blue. Therefore, a single GIF image may have at most 256 different colors in it, although these colors are chosen from a range of 2^24 different colors.
GIF images support the notion of a transparent color. A special code is appended to the GIF image stating that a certain color index is to be considered transparent. Applications understanding this code – not all do – allow the background to appear through the transparent pixels. This is often used to create attractive world wide web displays, since most web browsers understand the transparent color directive. The FME GIF writer module allows a transparent color index to be specified and it honors the transparent pixel when GIFs are used as point symbols, line styles or tiling fill patterns for polygons.
A GIF image background may be a solid color or it may be a tiled background pattern. The FME GIF writer supports either choice; however, if a background pattern is to be used, the pattern must come from another GIF file.
GIF images may be interlaced or non-interlaced. Interlaced GIF images download into many web browsers faster because the coarse image is displayed first, followed by more detail. The FME GIF writer supports both interlaced and non-interlaced output.
The image maps produced by the GIF writer consist of Hypertext Markup Language (HTML) code suitable for embedding into a web page displaying the created GIF image. As the mouse is moved over the GIF, each polygonal feature in the image will have a URL associated with it. This URL may bring up a dialog box with the feature’s attributes, or link to another web page.
PNG images can be output from the GIF writer. PNG is a graphic format which was designed from the ground up as an open source, standardized format unencumbered by some of the licensing issues that exist with the LZW compression method used by GIF. FME uses an RLE compression method for GIF output, which is equally unencumbered by licensing issues. PNG also adds a number of features over GIF, such as alpha channels, gamma correction, more advanced interlacing, and a greater variety of image depths. (However, FME does not currently take advantage of these features when writing.)
PNG images are currently handled natively by Microsoft® Internet Explorer 5 and above, Mozilla Firefox, and Opera. Other web browsers can access PNG images through the use of a browser plug-in, such as Apple® QuickTime® 41 QuickTime is a trademark of Apple Computer, Inc., registered in the U.S. and other countries..
The GIF writer generates PNG files instead of GIF files, when the output dataset names a file that ends in .PNG or .png. Other than this, there are no differences in the mapping file when dealing with PNG files as opposed to GIF files.
Writer Overview
The FME GIF writer creates a single GIF image and draws points, lines, and polygons into it. The file name, window, size, background, color table, transparency, and interlacing of the output image are all determined by mapping file settings. Each feature written to the image contains special attributes used to determine the appearance of the feature.
Feature types in GIFs are color entries. The color table entries are defined in GIF_DEF statements. All GIF features with the specified color name are drawn in that color.