rio-color icon indicating copy to clipboard operation
rio-color copied to clipboard

How to Run in 2024

Open kmarsh opened this issue 1 year ago • 1 comments

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"

kmarsh avatar Sep 20 '24 13:09 kmarsh

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

kylebarron avatar Sep 21 '24 11:09 kylebarron

@kmarsh Hopefully Vincent's fork has done the job for you in the meantime, but we've also just brought rio-color up to date: https://github.com/mapbox/rio-color/pull/92

. . . so you may have more luck running it now.

wboykinm avatar Dec 17 '24 14:12 wboykinm