reading image size in pixels

   4646   5   2
User Avatar
Member
85 posts
Joined: 6月 2015
Offline
Hello all,

I would like to change a planes resolution according an image resolution that I'm loading in, in a Cop2Network.
What would be the best solution to read in that info from a image?



Thanks, Robert
Houdini, Cinema4D, 3Dcoat, Marvelous Designer
User Avatar
Member
702 posts
Joined:
Offline
in the houdini textport type “exhelp res”

you can use this in your grid xy size, but you need to import the image into a cop network to access the information

float res (string compositing_node, float res_type)
REPLACED BY
hou.CopNode

Returns the natural resolution of the image in a compositing node.

<res_type> is either D_XRES or D_YRES.

EXAMPLES
res(“/img/img1/color1”, D_XRES)
User Avatar
スタッフ
5170 posts
Joined: 7月 2005
Offline
The Scale COP has an option to “Scale to the 2nd Input's Resolution”.

Note that you can't scale one plane and not the others. All planes must share the same resolution within a sequence, though the data window can differ.
User Avatar
Member
702 posts
Joined:
Offline
ahhhh… looks like twod has the option, I was reading this as wanting to size a 3d grid to the size of an image…but now you know how to that as well!
User Avatar
Member
85 posts
Joined: 6月 2015
Offline
Thanks a lot gentlemen for helping,

Again this showed me that I should be more precise with how to formulate a question ;-)
But SideImjay was indeed pretty close.
I would like to change the amount of x and y rows of a grid (actually size too) according to the resolution of an image that I loaded in, in a cop2network.
That way, each time the image gets changed both size and resolution of the grid gets changed accordingly.
I am new to Houdini so I will need to hurt my brains for quite a while beore I will be more comfortable with all this.

Regards, Robert
Houdini, Cinema4D, 3Dcoat, Marvelous Designer
User Avatar
Member
85 posts
Joined: 6月 2015
Offline
Ooooh………… That was actually pretty easy with: res(“../../TerrainMap/MAP_OUT”, D_XRES)

Houdini, Cinema4D, 3Dcoat, Marvelous Designer
  • Quick Links