Easy way to find out value range of a texture

is there an easy way to find out the total brightness range of a texture?
I often want to remap the range of someting but finding out from where to start remapping can be time consuming.

At the moment I create a plane give it a subdiv modifier and displace it with midlevels set to zero to see how far a map ranges. You also have to set the material to “displacement only” and all of this adds up.
From this we learn for example that the fac output of a standard noise texture ranges from around 0.25 to about 0.75 and the color output from around 0.3 to 0.7.

Is there some easier and more exact way to do this?

1 Like

OpenImageIO’s oiiotool with the --stats option will give you that info.

I don’t fully understand what that is. It appears to be a library but nothing that runs within Blender.
If it can be used in Blender how do you do that?

Or how would I get my texture into oiiotool?

2.81 has a remap value node that does what you want.
You can also do it with vector math: use the normalize node (range -1 to 1), then you have to scale by 0.5 and add 1 (now it’s 0-1). Make sure to do it all with vector math nodes. This is the old-school way to do it, before the awesome nodes that OmarSquircleArt added in his GSOC this past summer.

Most of the time it’s easier to set the values to an expected range and work from that than it is to try to figure out what they are.

Do you mean the map range node? I can not find a remap value node.

The problem with the map range node is that I don’t know from where to map to where.
Here is an image. In the green one the map range node is turned off, so I get the “regular” height of a noise map.
In the right image I remaped from min 0.25 and max 0.75 to min 0 and max 1.

But I only found out that I had to map from 0.25 and 0.75 because I tried it out with this displacement setup. I am basically looking for a way to figure this out without going through this process.

As for the vector math nodes. How do I use them? If I normalize a noise map it just flattens out everything at 1 if I plug the noise map into it.

Most procedural textures produce an output from 0-1, except for Musgrave which produces values from -1-1 (I think, not sure about that one). So you should map it from 0-1.

As for the vector math nodes- make sure to use a normalize, then an add (1,1,1) node, then a scale *0.5 node (I had them wrong the last time, or rather just in the wrong order). All vector math.

Again, this just remaps the values to 0-1 range.

What you want to do isn’t really possible; shader nodes act on the shading point itself, so it doesn’t know anything about any other point in the image or in space. So the node-tree has no way of knowing what the minimum and maximum values are in the procedural texture, since that would involve looking at all the other points and checking them. It would probably be easy to make a node in Cycles’s core that does this, but it’s not something you can do right now. Or rather, the normalize and map range node do this, but they remap the values, too.

I’m away from my own computer right now so I’ll check on this again later when I have access to a Blender (if this still isn’t working or doesn’t answer the question).

If you set the range from 0-1, do the two images look the same? It seems to me that the green image is the ‘regular’ height and the values of 0.25/0.75 introduce scaling and clipping.

If I set the range from 0-1 it looks like the left one where the map range is turned off.
The green image is the regular height, yes. It ranges from 0.25 to 0.75.
In the blue image i mapped it so that 0.25 to 0.75 ranges from 0 to 1.

I don’t think that is correct. As you can see in the green image the noise texture ranges from about 0.25 to about 0.75.

It depends, though. 0.25 to 0.75 is the range of the fac output.
The color output ranges from 0.3 to 0.7.

Voronoi ranges depending on which kind:
F1 Euclidian distance ranges about 0 to 1
F1 Manhatten distance ranges about 0 to 1.5
F1 Chebychev distance ranges about 0 to 0.8

F2 have similar ranges but they start and end about 0.2 later

Distance to edge ranges from 0 to 0.5
N-Sphere radius also ranges from 0 to 0.5

Musgrave is heavily dependant on type, and the settings of detail and dimension. And of course offset but that is the point of offset.

Here is another image. I included a scale this time. Perhaps it is clearer now.

1 Like

There’s a “histogram” widget in image viewer, supposed to show values distribution, but its implementation is totally decorative. It’s not even clear where are 0 and 1 there.

For specific point, there’s “pipette” tool that you can move around image and see precise values of rgb.

I am not really interested in the output of the image. I am more interested in what the maximum and minimum are which can be produced by a specific texture.

This is really the responsibility of the textures themselves. Ideally they all output values between nice numbers like 0 to 1, but sometimes figuring out how to do that can be difficult. If the noise node uses harmonics, there should be a theoretical min and max of the field, but that will never actually happen, so maybe that’s why you normally get values between roughly 0.3 to 0.7. I have noticed the same, I don’t think there’s an easy way around it unless someone forgot to adjust the range of that node.

1 Like

You could find an analytical min and max for that node by just rendering a whole bunch of it and chucking it into a histogram, that way you can determine how much data you want to go below 0 and 1, maybe you’re willing to accept a little in order to get a better range for the majority of points.

1 Like

Well, that is pretty much what I am doing by sending it through a displacement node. I just scale the noise to be very small, put it on a plane with adaptive subdivs and check how it deforms. This is time consuming but still better than rendering it out and analysing it.
I’m now making a table in which I can just look up how far which version of which texture ranges.
I think it would be a good idea to include something like that in the Blender manual.