Author Topic: Is there a way to get the size in pixels of an Input Image?  (Read 3691 times)

Is there a way to get the size in pixels of an Input Image?

Thanks for your help.


Hey maus,

What do you mean exactly? Do you need it for a function or just want to know what size the input image has?
The small info-button in the graph toolbar lets you toggle that info in the graph.

Best regards
Environment Artist - Twitter

In a function.


You should read the $size variable to get the size in a function. Or $sizelog2 if you want the size as a power of two (ie. 8,8 for a 256x256). Both are float2 variables, so you can read them using a "get float2" node.

Thanks but the $size variable "returns the size of the current node" not the size of an Input Image...

Thanks for your help though.


Hey maus,

if you set the Output size of a node to relative to parent, the node will have the same size as your input image and then you can read the correct size with $size :)

Best Regards
Environment Artist - Twitter

Thanks for the tip.

But my Input Images have different sizes then the Output of the FX Map or Pixel Processer...

I am trying to make a compound image of sorts, and knowing the size of all the different Input Images is important to the placement logic.

It looks like we can Sample the Color of an Input Image at X,Y but there is no way to get the Size an Input Image...

Last Edit: October 28, 2015, 01:30:35 pm

Something that could work (even if it's not automatic) would be to specify it using a parameter : you create new parameters that let the user specify the size of the different image inputs.
Then you get the parameters in your FxMap/Pixel processor and modify it accordingly.

Note you can hide parameters based on another parameter's value using the "Visible if" field. This way you can hide "Input image 3 resolution" if you only have 2 image inputs used.
Lead technical artist

Yah that's exactly what I have been doing, manually entering the width and height of Input Images...

I had hoped there was some way get the size of them because it makes the exposed interface of the substance I am working on much less friendly and really limits the random nature of input image selection.

Guess I can add it to my ever growing wish list for new features.

Thanks again everyone for trying to help me out.


Second this. I also asked for this feature in another thread a while ago.
Especially this feature would be very helpful for tools made for substance player.