10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.1.3 Clipping PathsPDFlib supports clipping paths in TIFF and JPEG images created with Adobe Photoshop.An image file may contain multiple named paths. Using the clippingpathname option ofPDF_load_image( ) one of the named paths can be selected and will be used as a clippingpath: only those parts of the image inside the clipping path will be visible, other partswill remain invisible. This is useful to separate background and foreground, eliminateunwanted portions of an image, etc.Alternatively, an image file may specify a default clipping path. If PDFlib finds a defaultclipping path in an image file it will automatically apply it to an image (see Figure6.1). In order to prevent the default clipping path from being applied set the honorclippingpathoption in PDF_load_image( ) to false. If you have several instances of thesame image and only some instances shall have the clipping path applied, you can supplythe ignoreclippingpath option in PDF_fit_image( ) in order to disable the clipping path.When a clipping path is applied, the bounding box of the clipped image will be used asthe basis for all calculations related to placing or fitting the image.Cookbook A full code sample can be found in the Cookbook topic images/integrated_clipping_path.6.1.4 Image Masks and TransparencyTransparency in PDF. PDF supports various transparency features, all of which are implementedin PDFlib:> Masking by position: an image may carry the intrinsic information »print the foregroundor the background«. This is realized by a 1-bit mask image, and is often usedin catalog images.> Masking by color value: pixels of a certain color are not painted, but the previouslypainted part of the page shines through instead (»ignore all blue pixels in the image«).In TV and video technology this is also known as bluescreening, and is most oftenused for combining the weather man and the map into one image.> PDF 1.4 introduced alpha channels or soft masks. These can be used to create asmooth transition between foreground and background, or to create semi-transparentobjects (»blend the image with the background«). Soft masks are represented by1-component images with 1-8 bit per pixel.Fig. 6.1Using a clipping path to separateforeground and background6.1 Importing Raster Images 125

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!