Previous Next


                                                   545
    SECTION 7.4                                                                Soft Masks



    • Result:
                                ⎛ α0           ⎞
      C = C n + ( C n – C 0 ) × ⎜ ------- – α 0⎟
                                        -
                                ⎝ α gn         ⎠
       f = fg
                n
      α = αg
             n


    Note: Once again, keep in mind that these formulas are in their most general form.
    They can be significantly simplified when some sources of shape and opacity are not
    present or when shape and opacity need not be maintained separately. Furthermore,
    in each specific type of group (isolated or not, knockout or not), some terms of these
    formulas cancel or drop out. An efficient implementation should use the simplified
    derived formulas.


7.4 Soft Masks

    As stated in earlier sections, the shape and opacity values used in compositing an
    object can include components called the mask shape (fm) and mask opacity
    (qm), which originate from a source independent of the object. Such an indepen-
    dent source, called a soft mask, defines values that can vary across different points
    on the page. The word soft emphasizes that the mask value at a given point is not
    limited to just 0.0 or 1.0 but can take on intermediate fractional values as well.
    Such a mask is typically the only means of providing position-dependent opacity
    values, since elementary objects do not have intrinsic opacity of their own.

    A mask used as a source of shape values is also called a soft clip, by analogy with
    the “hard” clipping path of the opaque imaging model (see Section 4.4.3, “Clip-
    ping Path Operators”). The soft clip is a generalization of the hard clip: a hard clip
    can be represented as a soft clip having shape values of 1.0 inside and 0.0 outside
    the clipping path. Everywhere inside a hard clipping path, the source object’s col-
    or replaces the backdrop; everywhere outside, the backdrop shows through un-
    changed. With a soft clip, by contrast, a gradual transition can be created between
    an object and its backdrop, as in a vignette.

    A mask can be defined by creating a transparency group and painting objects into
    it, thereby defining color, shape, and opacity in the usual way. The resulting group
    can then be used to derive the mask in either of two ways, as described in the fol-
    lowing sections.

Previous Next