Skip to main content
Nathan Lovell_52
Inspiring
August 25, 2016
Question

Generate mask based on luminance?

  • August 25, 2016
  • 1 reply
  • 661 views

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

This topic has been closed for replies.

1 reply

Legend
August 28, 2016

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.