Previous Next


                                              349
     SECTION 4.8                                                                     Images



     In PDF 1.5, optional content (see Section 4.10) can be used to facilitate selection
     between alternate images. If an image XObject contains both an Alternates entry
     and an OC entry, the choice of which image to use is determined as follows:

     1. If the image’s OC entry specifies that the base image is visible, that image is dis-
        played.
     2. Otherwise, the list of alternates specified by the Alternates entry is examined,
        and the first alternate containing an OC entry specifying that its content
        should be visible is shown. (Alternate images that have no OC entry are not
        shown.)


4.8.5 Masked Images

     Ordinarily, in the opaque imaging model, images mark all areas they occupy on
     the page as if with opaque paint. All portions of the image, whether black, white,
     gray, or color, completely obscure any marks that may previously have existed in
     the same place on the page. In the graphic arts industry and page layout appli-
     cations, however, it is common to crop or mask out the background of an image
     and then place the masked image on a different background so that the existing
     background shows through the masked areas. A number of PDF features are
     available for achieving such masking effects (see implementation note 54 in Ap-
     pendix H):

     • The ImageMask entry in the image dictionary, available in all versions of PDF,
       specifies that the image data is to be used as a stencil mask for painting in the
       current color.
     • The Mask entry in the image dictionary (PDF 1.3) may specify a separate image
       XObject to be used as an explicit mask specifying which areas of the image to
       paint and which to mask out.
     • Alternatively, the Mask entry (PDF 1.3) may specify a range of colors to be
       masked out wherever they occur within the image. This technique is known as
       color key masking.

     Note: Although the Mask entry is a PDF 1.3 feature, its effects are commonly simu-
     lated in earlier versions of PDF by defining a clipping path enclosing only those of an
     image’s samples that are to be painted. However, implementation limits can cause
     errors if the clipping path is very complex (or if there is more than one clipping
     path). An alternative way to achieve the effect of an explicit mask in PDF 1.2 is to

Previous Next