VEX: Get Min/Max Values of a Texture (the Fastest Way?)

   516   4   0
User Avatar
Member
1124 posts
Joined: April 2017
Offline
Hi!

I need to find the min and max value of a displacement texture. I was using a Detail Wrangle to go over each pixel but its a bit slow with 4K textures. Is there a trick to getting the min/max values faster (with less calculations)?

-Olivier
User Avatar
Member
4906 posts
Joined: Feb. 2012
Offline
Hi,

The fastest method is likely to load the texture into COPs and use the Volume Reduce SOP. You have to split the volume into scalar volumes using the Volume Vector Split SOP as Volume Reduce SOP doesn't support collated volumes.

Attachments:
volumereduce.png (2.7 MB)

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
9143 posts
Joined: July 2007
Online
you can also use Statistics COP or Prefix Sum COP
Edited by tamte - April 21, 2025 17:28:18
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1124 posts
Joined: April 2017
Offline
Oh, I was avoiding 20.5 because of the slow startup + crashes. I guess I wont have a choice.

Thanks for the infos!

-Olivier
User Avatar
Member
9143 posts
Joined: July 2007
Online
olivierth
I guess I wont have a choice.
You dont need 20.5 for Volume Reduce SOP
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links