Programmatically Set Gray Point in Curves Adjustment Using a Random Pixel
Hi everyone,
I'm trying to automate a color balancing process using Photoshop scripting. I'd like to achieve the following steps programmatically:
Duplicate the background layer.
Apply an Average Blur filter to the duplicated layer.
Add a Curves Adjustment Layer.
Select the middle pipette tool (sample in image to set gray point).
Simulate a mouse click on a random pixel of the blurred layer.
Hide the blurred layer after the gray point is set.
Merge all layers.
I've managed to script the first three steps, but I'm struggling with how to programmatically control the gray point pipette tool.
Is it possible to select this tool and simulate a click on a specific pixel through the API?
Alternatively, is there a way to directly set the gray point value in the Curves adjustment without using the pipette?
Any help or code examples would be greatly appreciated!
Thanks in advance for your help!