Hi Phil and Gerald,
What you are looking for is a batch adaptive stretch. This can be implemented very easily with PixelMath and ImageContainer. The PM code is as follows:
Combined RGB/K expression:
c = min( max( 0, med( $T ) + C*1.4826*mdev( $T ) ), 1 );
mtf( mtf( B, med( $T ) - c ), max( 0, ($T - c)/~c ) )
Symbols:
C = -2.8,
B = 0.25,
c
This applies an unlinked adaptive stretch function, just as it has been implemented for the AutoStretch function in the STF tool. If you prefer a linked AutoStretch, the expression would be:
Combined RGB/K expression:
m = (med( $T[0] ) + med( $T[1] ) + med( $T[2] ))/3;
d = (mdev( $T[0] ) + mdev( $T[1] ) + mdev( $T[2] ))/3;
c = min( max( 0, m + C*1.4826*d ), 1 );
mtf( mtf( B, m - c ), max( 0, ($T - c)/~c ) )
Symbols:
C = -2.8,
B = 0.25,
c,
m,
d
Which can only be applied to color images. In both cases the constants B and C define, respectively, the target mean background and the shadows clipping point in sigma units, in the [0,1] range. You can define an ImageContainer with your images to apply this PixelMath instance as a batch process. Let me know if it helps.