I'm trying to create a colormap (not sure about the right term) of the TIFF image - from this kind of image to such, and as i understand i need to modify all RGB values accordingly.
I'm having trouble with modifying existing image with Libtiff.net and there are example of how to read the RGBA values from the image (link), but no examples on how to write them into the image. (single one is missing actual writing the values into the raster). Maybe somebody had done something similiar or have experience with processing of RGB in TIFF images with this library.
If in future somebody would stumble upon same stuff, this is how i implemented it.
Code looks like this:
In RetrieveDataAccordingToChannel i read each Nth value - depends on the color channel that is chosen.
After that i create a new Bitmap where i write processed pixels.
Processing of values into new colormap looks like this (I took Colormap from https://github.com/ar1st0crat/SciColorMaps):