Seeking JavaScript Equivalent for Photoshop's "Find Neutral Gray" Technique for Batch Processing
Hi Photoshop Community,
I'm looking for a way to replicate the "Find Neutral Gray" technique described in this article ( https://www.photoshopessentials.com/photo-editing/neutral-gray/ ) using JavaScript. The article outlines a method to identify neutral gray areas in an image for color correction, which involves the following steps in Photoshop:
Create a new layer and fill it with 50% gray.
Set the layer's blend mode to "Difference".
Add a Threshold adjustment layer.
Adjust the Threshold slider to reveal the darkest areas, which represent areas closest to neutral gray.
Use the Color Sampler Tool to mark a point in the darkest area.
Remove the gray layer and Threshold layer.
Add a Levels or Curves adjustment layer and use the "Set Gray Point" eyedropper to click on the marked point, neutralizing the midtones.
I need to use this technique in batch actions within Photoshop. This means the JavaScript code needs to be suitable for automation within a Photoshop batch process.
If achieving this exact workflow with JavaScript in a batch process is not feasible, I'd be grateful for alternative suggestions. What other methods do you recommend for color correction that can be automated for batch processing, besides the standard automatic calculation of curves with "Find Dark & Light Colors" and the "Snap Neutral Midtones" option? I'm looking for a robust and reliable method that can be applied to a large number of images consistently.
Any guidance or code examples on how to approach this would be greatly appreciated!
Thanks in advance for your help.
