How can I apply a LUT (of e.g. 200 colors) to an image containing negative and positive float values (input.tif, scientific image, similar to a distance-map) on an absolute scale? I.e. I would like the first color of the LUT to be mapped to -0.57368 and the last color of the LUT to 0.673743.
Is that possible with IM?
I've been trying some variations of the command below but was so far defeated by the fact that u.p is in [0,1] and I do not know how to map that back to the original pixel values.
Code: Select all
convert -size 10x100 gradient:#f00-#f0f -size 10x100 gradient:#f0f-#00f -append LUT.png
convert input.tif LUT.png -fx "v.p{0,u.p*(2^`convert input.tif -format '%z' info:`-1) / ( 0.673743--0.57368 ) / 200 }" -transparent black output.png
Any help or hints would be very appreciated.
Roman