Jump to content

Changing Color components


logix1390

Recommended Posts

I have a bit of an interesting problem which I thought was going to be easy

I have one of Houdini's pictures loaded in : Mandril.pic

I want to change only the red areas to whatever color I want. 

I know there is the hue shift and color correct nodes... but that will hue shift all the colors at the same time.

How do I only Hue shift the red channel to change it to whatever color i want???

vector to float >float to vector doesn't seem to work for this situation ...probably because Cd.x is not a vector...

This is driving me a little crazy... I will attach my scene file with my attempted methods.

Thank you

change_color_component.hipnc

Link to comment
Share on other sites

In a point wrangle create an amount parameter (line 1) and convert the color values to HSV (line 2). Choose a range within the hue spectrum that is supposed to change (line 3). Multiply it by the amount and add the result to the hue component of the HSV color (line 4). Convert the color vector back to RGB (line 5).

float amount = chf('hue_shift');
vector col_hsv = rgbtohsv(v@Cd);
float range = chramp('mask_by_hue', col_hsv.x);
col_hsv.x += amount * range;
v@Cd = hsvtorgb(col_hsv);

change_color_component2.hipnc

Edited by konstantin magnus
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.

×
×
  • Create New...