Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9228873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:26:00+00:00 2026-06-18T05:26:00+00:00

I need to create a custom CSS filter that would convert black and white

  • 0

I need to create a custom CSS filter that would convert black and white image to two-color image with two custom colors.

I want to apply filter in something like this way (not sure if this syntax is possible, maybe 6 arguments have to be passed separately):

.duotone {
    -webkit-filter: custom(none url(/filters/duotone.fs),
        black_color [255, 0, 0] white_color [255, 192, 203]);
}

so that black color is replaced with Red in this case, both the white and transparent colours (background) are replaced with Pink and all the shades of grey are replaced with colour in between (using straight-line curve).

Maybe it is even possible to define filter in CSS without an external file?

The application of this filter is to convert black/white icons to colored icons at run-time.

There are very few examples on how to do it, this one is very generic covering much wider range of filters and the specification is also not so easy to understand.

Could somebody post a working filter doing this or something similar? Or at least maybe you could point me to some more focused examples of application of ColorMatrix that will be relevant to my situation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:26:01+00:00Added an answer on June 18, 2026 at 5:26 am

    UPDATE:

    In order to do that you will need to use -webkit-mask-image on CSS.
    This used to be a webkit only but it’s now w3c css3.

    The support is just present on webkit tho. In order to keep backward compatibility and display a regular black icon you will need to identify if the browser has this capabilities. I’v archived that using modernizr.

    http://jsfiddle.net/kkobold/Zq5FZ/5/

    old answer:

    I believe thats the result you are looking for:

    http://s7.postimage.org/vo5v33tuj/Screen_Shot_2013_02_03_at_11_28_46_PM.png

    you can archive it by filtering to sepia and then changing hue degree.
    different combinations will give different results. But a simple color
    picker can be made for the hue and a slide for sepia to increase or
    decrease intensity of the color change.

    and CSS3 only.

    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.0) hue-rotate(0deg);" width="300"/><br />
    -webkit-filter: sepia(0) hue-rotate(0deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(50deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(50deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(100deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(100deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(150deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(150deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(200deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(200deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(250deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(250deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(300deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(300deg);
    </div>
    <div class="pull-left span4" >
    <img src="/img/bw.jpg" style="-webkit-filter: sepia(0.8) hue-rotate(350deg);" width="300"/><br />
    -webkit-filter: sepia(0.8) hue-rotate(350deg);
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a custom page for my WordPress blog that will execute
I want to create a custom checkbox in HTML with CSS. When I am
I need to be able to create custom calendars that can omit certain holidays
I've got a custom component that I need to use if I create a
I need create custom dialog and put JPanel into it. Is it possible?
Need to create a custom DNS name server using C which will check against
I need to create a custom user interface using extJS/JSP which will allow me
I need to create a custom json for the jit library. Should I use
I need to create a custom component which consist of a drop down box,
I need to create a custom view, which extends RelativeLayout and simply needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.