badabou wrote:Fred, I looked at the source of the script and the variable $mid (-m) seems to be used anywhere. Is this normal ?
Thus, whatever its value, it has no impact on the final result.
Alternatively, is it possible to have a general method for the script is like Photoshop?
-r midtones is the argument and it is trapped at the bottom of the script at line 329 with
if [ "$region" = "midtones" ]; then
The argument mid is used to set the middle of the midtones region and defaults to the mean of the image. But it is only computed when region is not all (such as for midtones, shadows and highlights). See line 319
You are right about it not being used (unless it takes the default value). That is a mistake. I need to have it compute the low and high values (if not specified) from the mid value when the mid value is provided and not the default value. Give me a little time to fix this. I will get back shortly.
It may be possible to create something like PS colorbalance, but I do not know what algorithm is being used. It would take quite some effort of trial and error to try to figure out what they are doing and I may not be successful in the end.
I will put it on my to do list, but I have no idea when I will be able to get back to it.