Jump to content

ColorMatrixFilter


Retri
 Share

Recommended Posts

Would it be possible to make a ColorMatrixFilter (or something else for that matter) to change the hue of colors within a specific part of the spectrum?

 

I'm looking to mimic this (attached image) from photoshop -- here I'm changing the reds and moving them to green. Notice how the other colors are untouched.

The top of the rainbow is affected, the bottom is the source image.

 

post-13559-0-88166500-1431680720_thumb.p

Link to comment
Share on other sites

Hey.

Thanks for the input, but I don't see a way to only affect a specific colored pixel -- I'm not trying to change the hue of the entire image, but only a specific part of the color spectrum. Ie. turn blue (true blue, like hue 220 to 260, not the entire blue spectrum) pixels into red ones. This is a bit like chroma keying. Which I guess this could actually also be used for.

 

And as far as I can tell, you can't get pixel values in webgl, so I had to use canvas.

 

What I have now works, even if it's a bit clunky.

Link to comment
Share on other sites

And as far as I can tell, you can't get pixel values in webgl, so I had to use canvas.

 

You can in a shader, that is what the fragment shader does is determine the color of a pixel. Something like "if (gl_FragColor == colorToReplace) { gl_FragColor = replacementColor; }"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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