Jump to content

Ramp parameter colour values set automatically from image


anicg

Recommended Posts

Houdini, the mother of proceduralism, expects colour values to be set manually in the ramp parameter. Right?

i came across a feature in substance designer in gradient map called “pick gradient” that samples colour values from any part of an image you select with colour picker and it automatically populates the ramp/gradient with all the values it found. It gives a rich ramp. Don’t like the ramp values? Just click a different area, you get a different ramp (colours). Like the colours but not the ramp distribution? Just move a few colours around. This is procedural.

is there in Houdini (rightfully expected from a procedural software) a way to do something similar? At least not create colour by colour.

Edited by anicg
Link to comment
Share on other sites

If you're asking "is there a button that does this?", then the answer is almost. If you're asking, "can I do this?", then the answer is yes.

There's no button, but in the color editor you can load an image and pick colors from it, so you can do a gradient based on the image in a few clicks.

If you want to do it in one click, it's relative simple to sample image colors. You can take inspiration (or use it directly) something like this https://github.com/fengsp/color-thief-py

 

Link to comment
Share on other sites

Thanks.

I think the colour thief creates a colour palete. But the main point is to have Houdini ramp parameter populated by these colours. 

Making a colour palette is dead easy, it can be done in color.adobe.com, or even faster in Davinci resolve. It’s not about the colour palette, it’s about populating the ramp parameter in Houdini, and being able to change one’s mind and repopulate it within a couple of seconds with another palette.

If i use 7 colours (sometimes it can be 34 or more) i don’t want to waste time selecting each triangle in the ramp, click on the colour picker set one colour, and repeat it again, and again and again even of I’m selecting from a colour palette.

i don’t know python, and i don’t think i will learn it fast enough to code this myself.

Link to comment
Share on other sites

If you google "Techie Houdini", it's a .se site with a few Houdini tools. There's a 'Color Sampler 2.0' HDA that populates a ramp based on an input image. Has a ton of settings as well including samples, distribution of samples etc.

It's a free download but there are also a few paid ones on there and I'm not sure how frowned-upon linking to such things is.

If I recall Substance Designer has the line-painting mechanic? The HDA has a 'line mode' but as far as I can tell that just does the straight line. Doesn't look like modifying it to accept Draw Curve would take much work, though.

Edited by Dweeble
  • Like 1
Link to comment
Share on other sites

Thanks.

the color sampler 2 does create a ramp but:

- it seems like it keeps it for itself, no idea how to make houdini ramp parameter get those colours.

- it’s only in SOPs, not in COPs.

Do you know how to get those colours out of it and into the ramp parameter? (i have a ramp parameter inside a vopcop2gen in cops).

Edited by anicg
Link to comment
Share on other sites

Many thanks. I could link them with the usual “copy parameter” and “paste relative reference”. Now when i load a new image, both techie color sampler and houdini ramp parameter get updated. That’s what i was looking for, one click. Many thanks.

Link to comment
Share on other sites

  • 1 year later...

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...