Skip to main content
Solved

Transform grey-scale TIFF to specified colours


fbinneman
Contributor

Hi All

 

I am trying to convert a grey-scale raster (TIFF file) to one where the pixel colour is based on a scale of the Band 0 value that is specified for each pixel, where green is used as the lowest value and then scales to red for the highest value. The only transformer that I found where I can set the colour is the GradedColorizer.

I first used the RasterCellCoercer to get to the Ban 0 value (_band{0}.value) for each pixel and then uses in the the GradedColoriser. Once this transformer finishes its operations on the data, it gets sent to an ImageRasteriser to recreate a raster, which is then sent to a TIFF writer. The workbench file is attached here: . A test image can be found here: .

The workbench however fails at the ImageRasteriser, stating INVALID_VECTOR_GEOMETRY_COLOR as reason.

I must add that my understanding on raster bands are rather limited. I have also tried other transformers to keep the image as an image, and work with the Alpha band, but this seems to require more knowledge than I have.

Can anyone perhaps tell me what I am doing wrong here? I have had quite a look at the other questions on the knowledge base but was not able to find anything quite similar (and probably as basic as I am attempting to do).

Any help would be appreciated.

 

 

 

Best answer by takashi

Hi @francois_binnem, I think what you need is raster palette operations. The RGBGradationCalculator from FME Hub might help you to generate an appropriate palette definition.

See the attached workspace example: convert-gray-scale-to-color-image.fmwt (FME 2018.1.1)

Hope this helps.

View original
Did this help you find an answer to your question?

5 replies

takashi
Influencer
  • Best Answer
  • March 12, 2019

Hi @francois_binnem, I think what you need is raster palette operations. The RGBGradationCalculator from FME Hub might help you to generate an appropriate palette definition.

See the attached workspace example: convert-gray-scale-to-color-image.fmwt (FME 2018.1.1)

Hope this helps.


fbinneman
Contributor
  • Author
  • Contributor
  • March 13, 2019
takashi wrote:

Hi @francois_binnem, I think what you need is raster palette operations. The RGBGradationCalculator from FME Hub might help you to generate an appropriate palette definition.

See the attached workspace example: convert-gray-scale-to-color-image.fmwt (FME 2018.1.1)

Hope this helps.

Hi @takashi, thank you so much! It worked great!


Hello. I also need your advice, but the file "convert-gray-scale-to-color-image.fmwt" is no longer available! Could you add it? Thank you


fbinneman
Contributor
  • Author
  • Contributor
  • June 8, 2021
samuelnottebaer wrote:

Hello. I also need your advice, but the file "convert-gray-scale-to-color-image.fmwt" is no longer available! Could you add it? Thank you

Hi Samuel. I have an edited version of that file, which I have attached below my initial question now. Hopefully you can make use of that. Regards


Hi @fbinneman​ , thank you so much!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings