Jump to content

[Tip] How to apply grayscale to images/sprites without WebGL


MichaelD
 Share

Recommended Posts

Hello,

 

I just finished writing a small tutorial on how to apply grayscale to an image without using WebGL, and without re-creating all your assets as black&white to show unavailable/disabled/locked modes.

 

You can find it here: http://nightlycoding.com/index.php/2015/08/phaser-io-how-to-apply-a-grayscale-filter-tip/

 

If you only want the code and a quick example check out this codepen: http://codepen.io/netgfx/full/KpgLmV/

 

Let me know if you liked this technique!

Link to comment
Share on other sites

  • 1 year later...

Caveat #1: doesn't work in webgl. 

I thought that when you meant it works "without" webgl, that it works in canvas, in addition to webgl.

Caveat #2: anything underneath the sprite is going to be blended to. For example, if you have the sprite on top of terrain, the terrain will appear grayscale too. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...