mapbox / rio-color

Color correction plugin for rasterio
MIT License
131 stars 24 forks source link

Sigmoidal switch: no change #60

Closed IReese closed 5 years ago

IReese commented 5 years ago

I am having an issue with the sigmoidal switch when using the rio color commandline interface.

No matter what settings I use for the brightness swtich, the visuals on the output file do not change.

The following all produce the exact same result, with no visual change from the test file:

/usr/local/bin/rio color -d uint8 -j 4 ~/BG43_2016-12-06_2017-12-01.tif ~/BG43_2016-12-06_2017-12-01_SIGMOIDAL_brightness.tif sigmoidal rgb 1.0 0.4

/usr/local/bin/rio color -d uint8 -j 4 ~/BG43_2016-12-06_2017-12-01.tif ~/BG43_2016-12-06_2017-12-01_SIGMOIDAL_brightness.tif sigmoidal rgb 1.0 0.01

/usr/local/bin/rio color -d uint8 -j 4 ~/BG43_2016-12-06_2017-12-01.tif ~/BG43_2016-12-06_2017-12-01_SIGMOIDAL_brightness.tif sigmoidal rgb 1.0 1.001

The test file can be accessed here: https://linz-test-data.s3-ap-southeast-2.amazonaws.com/BG43_2016-12-06_2017-12-01.tif

I am running Ubuntu 18.04 and did the standard install for rio color: pip install rio-color

The gamma and saturation switches both work normally. For me, sigmoidal seems to be the only issue.

Is this a bug or am I missing something in my command structure?

sgillies commented 5 years ago

@IReese thanks for the report. We have numerical tests of the sigmoidal operation but not numerical tests of its use on the command line. I'll look into it. In the meanwhile, it looks like the sigmoidal contrast levels are small and the effects could be hard to see. Could you try turning the dial up to 11 or higher?

IReese commented 5 years ago

Contrast seems to work fine. Maybe this is a misinterpretation of the tool on my side.

I can control brightness if I ramp up the contrast at the same time. I think I was hoping I could use the sigmoidal switch to only play with brightness of the image and leave the contrast alone. It appears some value for the contrast needs to set in order for the brightness to function.

This produced more expected results:

/usr/local/bin/rio color -d uint8 -j 4 ~/BG43_2016-12-06_2017-12-01.tif ~/BG43_2016-12-06_2017-12-01_SIGMOIDAL_brightness.tif sigmoidal rgb 11.0 0.2

If this is the intended functionality of the switch, then we can attibute it to my misinterpretation of the tool and close the issue.

Thanks for the quick response :)