Jump to content

Group Curves by Image Color


jessela

Recommended Posts

I'm importing an Illustrator eps file and would like to group curves by the color in the original Illustrator file. EPS files don't pull in color data so I was wondering if it's possible to also reference a jpg image export of that Illustrator file and then pull the color from that to make curve groups.

So for example, in this image, I'm importing the Illustrator version of this but want to procedurally group all the green curves. How could I go about that?
Untitled.thumb.jpg.9a21f374be1f80d5983ea005952f948e.jpg

Link to comment
Share on other sites

You can use an expression in a group field based upon the Cd attribute. After you trace the image, follow that up with an attribute from map node to match the color to the newly traced geometry. Then promote Cd to primitives and filter from there. Another way would be to author each shape with a specific RGB color. The trace node can filer on the R, G, B, and A channels to give you only shapes of with that color.

NOTE: In this example I went ahead and "helped" out the trace node by removing the white background from the image. An RGBA PNG file is supplied to the trace with the JPG supplied to the attribute from map. This will allow trace to better find the the shapes in the picture.

ap_colors_from_trace.hiplc

Untitled-1.jpg

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

This seems promising, but does this work if the colors are stacked on top of each other? It seems like the example has the white and the grey removed, but if the grey outer circle is left in, does the trace and then attribute from map still pick up the different colors?

Link to comment
Share on other sites

No, so you'll have to prepare your layers correctly in Illustrator or Photoshop. A File node will read all the layers in the Illustrator file, so it's up to you to "delete" or throw away what you don't want, either in Illustrator, before export, or use a delete/blast node in Houdini after import.

COPs can read PSD files, so you might want to load your image that way, if that works better for you..?

Link to comment
Share on other sites

That's ok. I actually realized I was going about this wrong. I was thinking I wanted a tool that was an end all be all sort of thing, but this is just going to be a helper to make a longer process go faster. Since this will eventually end up in a 3d package, I can group the curves there and then run them through the Houdini Engine tool.

I did see that Labs had a PSD reader, but it seemed pretty slow.

Thanks for the help!

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