mapbox / rio-color

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

How to Run in 2024 #85

Open kmarsh opened 2 months ago

kmarsh commented 2 months ago

It seems this library has fallen behind in maintenance... I don't have the Python chops to get it up to date (ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject 🤷‍♂️) but I was able to get it to just run in a modern Docker container using uv. uv creates virtual environments with older Python versions on the fly.

So in case anyone just has some rasters they need to adjust color for in 2024 without forking or patching:

# install uv
curl -L https://astral.sh/uv/install.sh | sh

# run your command
uvx -p 3.8 --from rasterio --with rio-color rio color -j8 in.tif out.tif "gamma 1 1.3"
kylebarron commented 2 months ago

https://github.com/vincentsarago/color-operations from @vincentsarago is an updated fork