DamonOehlman / videoproc

Draw video frames to a canvas and analyse / modify pixel data
10 stars 1 forks source link

Is it possible to use css filters for this? #12

Closed balupton closed 10 years ago

balupton commented 10 years ago

I'm wondering if canvas can somehow grab the output of a css filter? As css filters are really powerful and really simplistic — bevry/interconnect#21

But perhaps one day, we can have our npm filters just as powerful, so we could do things like this:

processor.filters = [
  require('rtc-filter-grayscale')(0.5),
  require('rtc-filter-brightness')(9),
  require('rtc-filter-contrast')(9)
]
DamonOehlman commented 10 years ago

I'm not sure Ben - it seems unlikely but definitely worth investigating.

DamonOehlman commented 10 years ago

Hey Ben - I just revisited this issue and checked whether I could draw a video that had a CSS filter applied into a canvas, and see the effects of the filter applied in the drawn canvas data. As I suspected it's the original (unfiltered) image data that is drawn into the canvas, which means that CSS filter is applied after any current raster processing that is being applied for video / image / canvas elements.

silviapfeiffer commented 10 years ago

I don't think it's possible (also see http://stackoverflow.com/questions/13491038/save-a-canvas-with-css3-filters-applied-as-an-image for a discussion about this).