W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] question about canvas globalCompositeOperation

From: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
Date: Sat, 21 Aug 2010 17:54:45 +1000
Message-ID: <AANLkTin=r71qXki7hS=MABC39DoE+zQG+4GeaUWK8nrg@mail.gmail.com>
Hi all,

I've tried to work with the globalCompositeOperation [1] over the last days
for a particular use case where I am trying to use a gradient to merge with
a canvas as a mask. I now wonder if the globalCompositeOperation is indeed
meant to be used this way and what transparency means.

For example, "source-in" is defined as:
"A in B": Display the source image wherever both the source image and
destination image are opaque. Display transparency elsewhere.

What about partial transparency? I would expect the use of the canvas bitmap
B as a mask for the object or image A, where A becomes partially transparent
where-ever B is partially transparent. As it stands, browsers do not
implement it this way - only completely transparent pixels will create
transparency in A, which means when using a gradient that nothing become
partially transparent - it's either there or gone.

Should partial transparency in B not be dealt with as partial transparency
in the resulting display, too?

Apologies if this has been dealt with before. I'm looking at it with video
as the input medium, i.e. through drawImage(), trying to make it partially
transparent.

Cheers,
Silvia.


[1]
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100821/1612c9bc/attachment.htm>
Received on Saturday, 21 August 2010 00:54:45 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:26 UTC