This script is intended for use on linear (non-stretched) images with skewed RGB channels. If you have to unlink RGB in your Screen Transfer Function (STF) STF, you probably want this. The standard workflow:
- Split the RGB channels
- Calculate their median values
- Choose the channel with the lowest median value
- Run LinearFit using the reference channel on the other channels
- Use LRGBCombination to merge the fit channels back into the original image
Parameters allow you to use max instead of min, generate a new image instance, and control noise reduction.