This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14857 - Shouldn't filter effects work with Canvas 2D context?
Summary: Shouldn't filter effects work with Canvas 2D context?
Alias: None
Product: CSS
Classification: Unclassified
Component: Filter Effects (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: This bug has no owner yet - up for the taking
Depends on:
Reported: 2011-11-17 15:51 UTC by Vincent Hardy
Modified: 2012-11-08 14:57 UTC (History)
4 users (show)

See Also:


Description Vincent Hardy 2011-11-17 15:51:37 UTC
Shouldn't we coordinate with the Canvas spec. editor to get filter effects to work with Canvas? The idea would be to have the following work:

var ctx = canvas.getContext('2d');

ctx.filter = "grayscale(0.5)";

// from there on, all rendering calls are conceptually filtered before being composited on the canvas.
Comment 1 Dean Jackson 2011-11-18 20:03:17 UTC
I agree we should do this. I wonder about the modality of the effect though. I don't think you'd want every operation to filter - rather you'd want to set a filter mode, draw a lot of stuff, then apply the filter to the collected content. This is similar to group opacity in SVG and transparency layers in CoreGraphics.
Comment 2 Simon Fraser 2011-11-18 20:03:58 UTC
If you're using canvas, you can already do filter-like effects via image data.
Comment 3 Dirk Schulze 2012-11-08 14:53:57 UTC
I don't think this is in the scope of this implementation (Filter Effects). And as Simon said, you can use ImageData already.