Solved

How to create 256 color raster, where black color is exact on 0 index palette position, and white on 255?


Badge

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.

icon

Best answer by geosander 4 March 2016, 14:00

View original

8 replies

Userlevel 2
Badge +17

Hi @arekpierchala, the RasterPaletteGenerator transformer might help you.

Badge +7

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.

Badge

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

Userlevel 2
Badge +17

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?

Badge +7

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

Badge +7

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).

Badge

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

Userlevel 4
Badge +25

@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