Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the CSS Filter alternative for Firefox?

I'm using CSS Filters to modify images on the fly within the browser. These work perfectly in Internet Explorer, but aren't supported in Firefox.

Does anyone know what the CSS Filter equivalent for these is for Firefox? An answer that would work cross browser (Safari, WebKit, Firefox, etc.) would be preferred.

<style type="text/css">
    .CSSClassName {filter:Invert;}
    .CSSClassName {filter:Xray;}
    .CSSClassName {filter:Gray;}
    .CSSClassName {filter:FlipV;}
</style>

Update: I know Filter is an IE specific feature. Is there any kind of equivalent for any of these that is supported by Firefox?

like image 857
Chris Pietschmann Avatar asked Oct 01 '08 03:10

Chris Pietschmann


3 Answers

Please check the Nihilogic Javascript Image Effect Library:

  • supports IE and Fx pretty well
  • has a lot of effects

You can find many other effects in the CVI Projects:

  • they are also JS based
  • there's a Lab to experiment

Good Luck

like image 172
Andre Bossard Avatar answered Oct 07 '22 15:10

Andre Bossard


Could you give us a concrete example of what exactly you're trying to do? You'd probably get fewer "Your brower sux" responses and more "How about trying this different approach?" ones.

Normally CSS is used to control the look and feel of HTML content, not add effects or edit images in clever ways. What you're trying to do might be possible using javascript, but a behavior-oriented script still probably isn't very well suited for the kind of tweaking you want to do (although something like this is a fun and very inefficient adventure in CSS / JS tomfoolery).

I can't imagine a scenario when you would need the client to perform image tweaking in real-time. You could modify images server-side and simply reference these modified versions with your CSS or possibly Javascript, depending on what you're doing exactly. ImageMagick is a great little command-line tool for all the image effects you would ever need, and is pretty simple to use by itself or within the server-side language of your choice. Or if you're using PHP, I believe PHP's GD library is pretty popular.

like image 31
Rudi Avatar answered Oct 07 '22 17:10

Rudi


There are no equivalents in other browsers. The closest you could get is using a graphics library like Canvas and manipulating the images in it, but you'd have to write the manipulations yourself and they'd require JavaScript.


filter is an IE-only feature -- it is not available in any other browser.

like image 29
John Millikin Avatar answered Oct 07 '22 16:10

John Millikin