W3C home > Mailing lists > Public > www-svg@w3.org > December 2000

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

From: Jon Ferraiolo <jferraio@Adobe.COM>
Date: Mon, 11 Dec 2000 20:56:15 -0800
Message-Id: <4.2.2.20001211085736.025f4420@mailsj.corp.adobe.com>
To: Chris Lilley <chris@w3.org>
Cc: www-svg@w3.org
At 01:41 AM 12/10/00 +0100, Chris Lilley wrote:
>  Return-Path: <www-svg-request@w3.org>
>Received: from www19.w3.org (www19.w3.org [18.29.0.19])
>         by tux.w3.org (8.9.3/8.9.3) with ESMTP id JAA14296
>         for <chris@w3.org>; Mon, 4 Dec 2000 09:56:07 -0500
>Received: by www19.w3.org (8.9.0/8.9.0) id JAA22277
>         for chris@w3.org; Mon, 4 Dec 2000 09:56:07 -0500 (EST)
>Date: Mon, 4 Dec 2000 09:56:07 -0500 (EST)
>X-Envelope-From: www-svg-request@tux.w3.org  Mon Dec  4 09:55:56 2000
>Received: from tux.w3.org (tux.w3.org [18.29.0.27])
>         by www19.w3.org (8.9.0/8.9.0) with ESMTP id JAA22257
>         for <www-svg@www19.w3.org>; Mon, 4 Dec 2000 09:55:56 -0500 (EST)
>Received: from ron.emn.fr (ron.emn.fr [193.104.34.98])
>         by tux.w3.org (8.9.3/8.9.3) with ESMTP id JAA14268
>         for <www-svg@w3.org>; Mon, 4 Dec 2000 09:55:53 -0500
>Received: from imail.info.emn.fr (root@imail.info.emn.fr [193.104.32.92])
>           by ron.emn.fr (8.9.3/jtpda-5.3.1) with ESMTP id PAA15015
>           for <www-svg@w3.org>; Mon, 4 Dec 2000 15:55:12 +0100 (MET)
>Received: from emn.fr (IDENT:conversy@dhcp6 [193.104.32.232])
>           by imail.info.emn.fr (8.9.3/jtpda-5.1) with ESMTP id PAA17401
>           for <www-svg@w3.org>; Mon, 4 Dec 2000 15:54:42 +0100 (MET)
>Sender: conversy@emn.fr
>Message-ID: <3A2BB045.527B127F@emn.fr>
>Old-Date: Mon, 04 Dec 2000 15:55:01 +0100
>From: Stephane Conversy <conversy@emn.fr>
>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
>To: www-svg@w3.org
>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
>
>Hello.
>
>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
  (http://www.w3.org/TR/SVG/render.html#PaintingShapesAndText), 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 
(http://www.w3.org/TR/SVG/masking.html#ObjectAndGroupOpacityProperties):

"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"
            style="fill:red"/>
    <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
jferraio@adobe.com
Received on Tuesday, 12 December 2000 11:59:43 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:19 GMT