Skip to main content

I want to create rasters from vector data. I've used ImageRasterizer and set background color into white, then write data as geotif with 8BiitsPerCell parameter. Finally got 24bit raster with 16,7milions colors but I need 256 color raster with black color on 0 index palette position, and white(background) on 255.

Hi @arekpierchala, the RasterPaletteGenerator transformer might help you.


Hi @arekpierchala, the RasterPaletteGenerator transformer might help you.

True! Set the interpretation type of the ImageRasterizer to RGB24 and leave the interpretation type of the RasterPaletteGenerator on UInt8. Set to "Number of Palette Entries" to 256 of course.


True! Set the interpretation type of the ImageRasterizer to RGB24 and leave the interpretation type of the RasterPaletteGenerator on UInt8. Set to "Number of Palette Entries" to 256 of course.

Hi @takashi and @sander_s

Still something is wrong. When write into TIFF, FME create file with
orignal colors =256, but current colors pallete is still in fact 16,7
millions


Hi @takashi and @sander_s

Still something is wrong. When write into TIFF, FME create file with
orignal colors =256, but current colors pallete is still in fact 16,7
millions

I'm not sure what the "Current colors" in the screenshot means. Can you inspect the actual data structure of the tiff raster with FME Data Inspector?


@arekpierchala

You have to set the Interleaving Type on the Format Parameters tab (on the GeoTIFF writer) to BIP. That will do the trick.

According to the docs, palettes in FME are "Band Interleaved by Pixel" (BIP).


Hi @takashi and @sander_s

Still something is wrong. When write into TIFF, FME create file with
orignal colors =256, but current colors pallete is still in fact 16,7
millions

It's an IrfanView screendump ;)

You have to set the Interleaving Type on the Format Parameters tab (on the GeoTIFF writer) to BIP. That will do the trick.

According to the docs, palettes in FME are "Band Interleaved by Pixel" (BIP).


I'm not sure what the "Current colors" in the screenshot means. Can you inspect the actual data structure of the tiff raster with FME Data Inspector?

parcels-good.zip

256colorrasterizer.fmwt

 

please look at the template, DataInspector shows 256 pallete, but when I open the image e.g. in IrfanView the pallete is in fact in millions. Need raster as attached 'parcels-good.tif' - IrfanView shows for that file current and original colors = 256


@arekpierchala

You have to set the Interleaving Type on the Format Parameters tab (on the GeoTIFF writer) to BIP. That will do the trick.

According to the docs, palettes in FME are "Band Interleaved by Pixel" (BIP).

Good find. It would have taken me a while to think of that!


Reply