Performance of saturation
See original GitHub issueSaturation operator needs to be faster. It’s really slow compared to imagemagick’s modulate.
$ rio info $orig | jq .shape
[
8192,
8192
]
$ time rio color $orig f416_rio_lch.tif "saturation 130"
real 1m10.490s
$ time convert $orig -modulate 100,130 f416_magick.tif
real 0m6.954s
Investigating…
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Performance - Saturation (Wait Time|Queue Length)
Saturation is where a resource has more load than it can handle. It can be seen either as: the length of a request...
Read more >Mitigating Performance Saturation in Neural Marked Point ...
Neural marked point processes possess good interpretability of probabilistic models as well as the representational power of neural networks.
Read more >Performance Bottleneck : High CPU Utilization vs High CPU ...
But what about CPU Saturation? Should we also scale when the CPU is saturated, but the utilization is low (say 40%). Here it...
Read more >Performance of saturation diving emergency hyperbaric ...
This appendix relates to IOGP 478 – Performance of saturation diving emergency hyperbaric evacuation and recovery. Get it now.
Read more >Best achievable control system performance: the saturation ...
This paper proposes a methodology for the quantification of the best achievable closed loop control system performance for a linear process in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Instead of going through the CLI, a direct comparison might be more illustrative of the performance difference:
Saturation on a 4096x4096 array gives us
So the Cython is about 68% faster for a large array. Modest but significant.
See https://github.com/mapbox/rio-color/pull/22 for cython implementation
Benchmarks
Tested on 4096x4096 tiled, uncompressed, rgba GeoTIFF. New method is significantly faster than old. Not as fast a imagemagick but it works better, retaining the profile of the input data.
convert -modulateconvert -set option:modulate:colorspace lch -modulaterio color "saturation ..."rio color "saturation ..."Bottom line is performance is 1/3 better than the skimage method but still way slower than our HSV-based saturation with convert.
Visuals
The results are not floating-point-exact with the skimage method but, when cast to 8bit rgb there is no perceptual difference.
Here’s a demo of the saturation. I chose to use a stock photo instead of satellite image since it more clearly demonstrates the effect of saturation. This was created by the following rio_color script
saturation ranging from 0 (B&W) to 250% (garishly over-saturated). Sorry about the giffiness of the image - you get the idea though.