Skip to main content

I got some multiband raster images and want to create a workspace which allows the user to choose the bit depht/color depht between Grayscale (8bit), RGB(24bit) and Palette (8bit). I used the RasterInterpretationCoercer but it does not work with the Grayscale, because the input images contains multiple bands. Anynone can give me a hint to make it possible?

 

Thx and best wishes Barry

Depends on the outcome you want, but you can use the RasterBandSeparator to split up the R, G and B bands and coerce them individually. If you look in the transformer gallery and look for all transformer names starting with "rasterband...", it might give you some ideas.

There is also the RasterPaletteGenerator if you want to generate a palette based on e.g. RGB input.


At first let me thank you for the reply. Unfortunately im still confused, when I create a Palette with the RasterPaletteGenerator for example with the following settings:

 

Palette Key Interpretation Type: UInt18

Maximum Number of Palette Entries: 256 (I choose 256 for the 8bit Grayscale?)

 

I get as result only a single band picrture but with colors, but how can I create a greyscale picture?

 

If I put the RasterGenerator at first and afterwards the RasterInterpretationCoercer (with Grayscale8 setted) I get as Result 8 bit pictures with a 256 color palette and they go to the rejected port. What is my mistake? I added some screenshots maybe they help.

 

Screenshot 2020-12-11 204218Screenshot 2020-12-11 203208 


At first let me thank you for the reply. Unfortunately im still confused, when I create a Palette with the RasterPaletteGenerator for example with the following settings:

 

Palette Key Interpretation Type: UInt18

Maximum Number of Palette Entries: 256 (I choose 256 for the 8bit Grayscale?)

 

I get as result only a single band picrture but with colors, but how can I create a greyscale picture?

 

If I put the RasterGenerator at first and afterwards the RasterInterpretationCoercer (with Grayscale8 setted) I get as Result 8 bit pictures with a 256 color palette and they go to the rejected port. What is my mistake? I added some screenshots maybe they help.

 

Screenshot 2020-12-11 204218Screenshot 2020-12-11 203208 

I'm not quite sure what you're trying to accomplish, in particular the inferred relationship between the palette and the RasterInterpretationCoercer.

If you just need to create a single-band grayscale version of an RGB input raster, you can use the RasterInterpretationCoercer by itself, just be sure to set the destination interpretation type to either Gray8 or Gray16 depending on the input raster. Also, make sure to specify a bounded cast for the color-to-color conversion. For example:

2020-12-14 09_31_36-RasterInterpretationCoercer Parameters


Reply