Skip to main content

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.

 

 

 

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 @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


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!


Reply