How to completely gray out an image with css?


Tags: css,image

Problem :

I have this image: enter image description here.

I need to gray it out to look like this: enter image description here.

Using the response in this SO question: Gray out image with CSS?

 opacity : 0.4;
 filter: alpha(opacity=40); /* msie */

I get this: enter image description here

Setting the filter property to filter: grayscale(100%) still leaves changes in the colors: enter image description here

Anyway I can make it completely gray?



Solution :

It sounds like you are trying to change the actual pixels in an image. I believe what you are looking for is something like.

Pixastic (coloradjust)

https://github.com/jseidelin/pixastic

http://www.pixastic.com/lib/docs/actions/coloradjust/

or PaintbrushJS (colour tint)

https://github.com/mezzoblue/PaintbrushJS

http://mezzoblue.github.com/PaintbrushJS/demo/


    CSS Howto..

    how can I position my img right?

    How to apply a CSS class on hover to dynamically generated submit buttons?

    How do I make my React Components to be responsive via css media queries?

    How do customize option box that pops up when selectbox is clicked (iOS, HTML, CSS)

    Show bottom of an overflow string in a div with fixed height/width?

    How to change the background color of a span/div WITHOUT CSS [closed]

    How to get CSS background images to show up in HTML files opened by Word?

    How to show/hide a 3 levels menu nav in css?

    How does one load a CSS framework in Rails 3.1?

    How to make a full page JS and CSS menu

    How to resize the images to have the same height in group while keeping aspect ratio?

    CSS: How to limit horizontal/vertical scrolling?

    how to get by title attribute

    How do I center align form

    How to create some elegant shadows in CSS [closed]

    How to make a div box with display:flex clickable like display:block?

    How to create an enumerated tabular environment in HTML/CSS?

    Bootstrap shows black rectangles when printing focused input elements

    how to position element equally from left and right sides?

    How to create circles around a circle with css, javascript?

    how to make nav auto adjsust its menu items using css?

    How to change table width using css

    How do I change the css so lowering one class does not lower the other?

    How to reorder controls of WYSIWYG editor

    How to scroll the fixed content in CSS and HTML

    How to utilize css of this style in LESS?

    How to simulate multiple
    tag with CSS

    How to fix responsive drop down menu using css?

    Base 64 CSS background image not showing in IE

    float css only menu - how to modify on section2