Copy link to clipboard
Copied
Hi,
I am familiar with how to create masks within scripting. However, I was wondering if there is any way to generate them based off of luminance values. For example, with this image of fractal noise, would it be possible for a script to procedurally generate a mask around one of the white areas?
Many thanks,
Nate
Copy link to clipboard
Copied
Possible? Anything is possible. Easy? Highly unlikely.
What you are asking for is a blob detection algorithm like this : BlobDetection library / v3ga You might be able to use this code as a foundational guide for the concept of how to approach building it in ExtendScript maybe. It would require outside libraries is my guess, as ExtendScript isn't this powerful by itself.
Another thought would be using the layer expression sampleImage() as a feeder of color information somehow and then read that via script to then process and try to determine a white area. I doubt the resulting mask detail would be of any high quality due to how heavy sampleImage would be just to gather all of the pixel info to even begin the math of blob detection.