Chapter 9. Embedded Images

Table of Contents
9.1. Entities as images
9.2. Elements containing images

Embedded Images can occur in a document and will be shown by epcEdit. They will be shown inline at the position where they occur in the document. Embedded images must reside in an external file and will be displayed by epcEdit if the file format of the external data file can be handled by epcEdit. Currently, the following graphic formats can be displayed:

BMP

Microsoft windows bitmap format. A simple graphics file format developed by Microsoft for its Windows operating system. BMP files can store graphics from 1-bit (2-color) up to 24-bit (16.7 millions of colors). The BMP format does not support any method of compression.

XBM

X Windows bitmap format. An X-formatted black and white bitmap image. This image format is specific to X; it is simultaneously a bitmap format and legal C language source code.

XPM

X Windows pixmap format. X-formatted color bitmap image.

GIF

Graphics Interchange Format. This image format was originally developed by CompuServe in 1987 to transmit graphics files across computer networks. The GIF format is limited to 8-bit or in other words 256 color images, and the image data is compressed with the LZW algorithm. Unlike JPEG, the GIF format is lossless and does not produce artifacts on images. In 1989, CompuServe added additional features to the format such as transparency, interlace, and the ability to store multiple images in a single file. Because of patent issues and other inherent limitations GIF is expected to be slowly replaced by the free and superior PNG format.

PPM/PGM

Portable Pix Map / Portable Grey Map. These are two variants of the Portable aNy Map (PNM) file format which is actually a collection of file formats. PNM files (the raw versions) are good, simple, and useful file formats for colour, grey scale, and binary images. epcEdit supports the PPM format (the colour version of PNM) and the PGM format (the grey-scale version of PNM).

PNG

Portable Network Graphics. This is a lossless graphics file format that combines many of the benefits of GIF and JPEG. Unlike GIF files, there are no patent restrictions, and the file format is maintained in an open source environment. PNG also allows for many features that the GIF format doesn't, including 254 levels of transparency (GIF supports only one), more control over image brightness, and support for more than 256 colors. PNG also supports progressive rendering, as interlaced GIFs do, and tends to compress better than a GIF

JPEG

Stands for Joint Photographic Experts Group. A lossy image compression algorithm to reduce file sizes dramatically. Artifacts may occur on compressed images due to the fractal based algorithm.

TIFF

Tagged Image File Format. TIFF can handle color depths ranging from one-bit (black and white) to 24-bit photographic images with equal ease.

Postscript

Page description language developed by Adobe Systems. epcEdit needs GhostScript to display Postscript and EPS images. Because of licensing issues, GhostScript can not packaged with epcEdit.

Embedded images can occur in two variants: As entity references or as values of an image attribute in an XML/SGML element.

9.1. Entities as images

References to external NDATA entities can be shown as embedded images. For this purpose, the following conditions must be met:

If these requirements are fulfilled, epcEdit will read the file containing the image data and create an inline image. This inline image will appear at all locations where the external NDATA entity is referenced in your document.

The following example provides a fragment from a DTD that declares a notation and shows an entity declaration that could occur in the DTD or the document prolog.

<!NOTATION JPG SYSTEM "JPG"><!ENTITY img1 SYSTEM "images/img1.jpg" NDATA JPG>

When epcEdit encounters a reference for the img1 entity in your document, it would display the image contained in the file images/img1.jpg where the entity reference occurred.

This behavior applies only to the way an entity reference is shown by epcEdit; when the document is saved to a file, the entity reference is retained. The embedded image serves as a placeholder for the entity reference. When you delete the embedded image from your document, epcEdit will remove the reference to the external entity.

Entity references for image entities are only shown as embedded images if the Show Entity Names option is turned off (see Entities). If this option has been turned on, entity references are always shown by entity name.