Re: [Fwd: [Moderator Action] alpha transparency]

At 01:41 AM 12/10/00 +0100, Chris Lilley wrote:
>  Return-Path: <>
>Received: from ( [])
>         by (8.9.3/8.9.3) with ESMTP id JAA14296
>         for <>; Mon, 4 Dec 2000 09:56:07 -0500
>Received: by (8.9.0/8.9.0) id JAA22277
>         for; Mon, 4 Dec 2000 09:56:07 -0500 (EST)
>Date: Mon, 4 Dec 2000 09:56:07 -0500 (EST)
>X-Envelope-From:  Mon Dec  4 09:55:56 2000
>Received: from ( [])
>         by (8.9.0/8.9.0) with ESMTP id JAA22257
>         for <>; Mon, 4 Dec 2000 09:55:56 -0500 (EST)
>Received: from ( [])
>         by (8.9.3/8.9.3) with ESMTP id JAA14268
>         for <>; Mon, 4 Dec 2000 09:55:53 -0500
>Received: from ( [])
>           by (8.9.3/jtpda-5.3.1) with ESMTP id PAA15015
>           for <>; Mon, 4 Dec 2000 15:55:12 +0100 (MET)
>Received: from (IDENT:conversy@dhcp6 [])
>           by (8.9.3/jtpda-5.1) with ESMTP id PAA17401
>           for <>; Mon, 4 Dec 2000 15:54:42 +0100 (MET)
>Message-ID: <>
>Old-Date: Mon, 04 Dec 2000 15:55:01 +0100
>From: Stephane Conversy <>
>Organization: Ecole des Mines de Nantes
>X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.13-2SGI_21 i686)
>X-Accept-Language: en
>MIME-Version: 1.0
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>X-Diagnostic: Not on the accept list
>Subject: [Moderator Action] alpha transparency
>X-Diagnostic: Mail coming from a daemon, ignored
>X-Envelope-To: www-svg
>X-Mozilla-Status2: 00000000
>What happens when 'opacity', 'fill-opacity' and 'stroke-opacity'
>are all set for a particular simple shape ?
>are they composed ?
>     stef

The simple answer is Yes. To explain more fully:

In 3.5.1 Painting shapes and text
  (, the spec says:

"...The fill is painted first, then the stroke, and then the marker 
symbols. ...

...Each fill and stroke operation has its own opacity settings; thus, you 
can fill and/or stroke a shape with a semi-transparently drawn solid color, 
with different opacity values for the fill and stroke operations...."

And then in 14.5 Object and group opacity: the 'opacity' property 

"There are several opacity properties within SVG:

* Fill opacity
* Stroke opacity
* Gradient stop opacity
* Object/group opacity (described here)

Except for object/group opacity (described just below), all other opacity 
properties are involved in intermediate rendering operations. Object/group 
opacity can be thought of conceptually as a postprocessing operation. 
Conceptually, after the object/group is rendered into an RGBA offscreen 
image, the object/group opacity setting specifies how to blend the 
offscreen image into the current background. "

Although things can get complicated in situations where you have 
transparent gradients and/or clipping paths and/or masks, in the following 
simpler case:

    <rect x="0" y="0" width="100" height="100"
    <rect x="0" y="0" width="100" height="100"
            style="fill:blue; fill-opacity:.5; opacity:.5"/>

Because the second rectangle's fill have a 'fill-opacity' of .5, and the 
overall object itself has an 'opacity' of .5, then the blue fill of the 
second rectangle is blended into the background (which, in this case, is 
red) with an overall opacity value of .25. The resulting pixels will be 75% 
red and 25% blue.

Jon Ferraiolo
SVG Editor

Received on Tuesday, 12 December 2000 11:59:43 UTC