IMAGE TO RAMP HDA

“Why can’t I just draw a line on an image and create a ramp with the sampled colors?”

Here’s my “sprint” Houdini HDA Sop tool I made to do just that!

Install the hda, lay down an Image To Ramp node, load an image, draw some lines and draws some lines. For every line you get a ramp.

Just be sure to turn on your “Display materials on objects” in your viewport... the checkered cube on the right-side… that’s the one!

From there you then either channel reference it on to a ramp parameter elsewhere in your setup for it to live update, or just copy the ramp’s values - all via the usual right click menus.

An interesting issue I hit was, at the time of writing this, Houdini’s Python HOM interface doesn’t support querying array attributes on prims, so I had to bounce them down to a detail attribute… classy.



NOTES

  • Recent updates include OCIO colour setting for sampled colour. Note, these won’t show up in the display. (Beta)

  • Remember to toggle off Auto Update on ramps you don’t want to auto rebuild on the multi ramp modes - draw and curves in.

  • If the images animates, the ramps can animate the ramps auto update too!

  • You can bake out all the ramps to images so you can use them in other applications!

  • 2nd output has colour values on the curves. Points represents ramp handles.

  • Currently only a full Parameter Tab will keep the current stroke as the open tab.

  • You need to visualise the node to update the ramp.

  • All modes put out prims per ramp with colours (Cd) on the points.





If you want to download this tool for free (sweet!)oPlease consider subscribing if you’d like to keep updated with what I’m up to or follow me on Twitter DoesCG.

DOWNLOAD











UPDATES

19.30 GMT 2020-11-30, verison 0.3

  • Bake ramps to images.
  • Automatically change ramp tab so you can see it as you draw.

19.49 GMT 2022-01-07, version 0.4

  • Fixed exec call. Fixed and now working Houdini 19.0.455
  • Full commercial license. Was /hdalc now is .hda!
  • Basics OCIO color support. (Beta)

18.10 GMT 2022-01-12, version 0.5

  • Cluster mode .
  • Curves In mode.

18.10 GMT 2022-02-26, version 0.8

  • Restructure of interface and workings.
  • Hex Clipboard mode added.
  • Sort by Hue on Cluster mode - making much cleaner ramps.

18.10 GMT 2022-02-27, version 0.9

  • Improved ramp re-draw reliability.
  • Curves In can use Cd attribute on incoming from points.