Convert an image to grayscale in HTML/CSS

前端 未结 25 1819
青春惊慌失措
青春惊慌失措 2020-11-22 10:22

Is there a simple way to display a color bitmap in grayscale with just HTML/CSS?

It doesn\'t need to be IE-compatible (and I imagine it won\'t be) -- if

25条回答
  •  悲&欢浪女
    2020-11-22 10:39

    One terrible but workable solution: render the image using a Flash object, which then gives you all the transformations possible in Flash.

    If your users are using bleeding-edge browsers and if Firefox 3.5 and Safari 4 support it (I don't know that either do/will), you could adjust the CSS color-profile attribute of the image, setting it to a grayscale ICC profile URL. But that's a lot of if's!

提交回复
热议问题