Skip to main content
Solved

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


arekpierchala
Contributor
Forum|alt.badge.img+1

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.

Best answer by geosander

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

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

8 replies

takashi
Influencer
  • March 4, 2016

Hi @arekpierchala, the RasterPaletteGenerator transformer might help you.


geosander
Forum|alt.badge.img+7
  • March 4, 2016
takashi wrote:

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.


arekpierchala
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 4, 2016
geosander wrote:

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


takashi
Influencer
  • March 4, 2016
arekpierchala wrote:

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?


geosander
Forum|alt.badge.img+7
  • Best Answer
  • March 4, 2016

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


geosander
Forum|alt.badge.img+7
  • March 4, 2016
arekpierchala wrote:

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


arekpierchala
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 4, 2016
takashi wrote:

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


mark2atsafe
Safer
Forum|alt.badge.img+44
geosander wrote:

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


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