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?

  • March 4, 2016
  • 8 replies
  • 54 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

takashi
Celebrity
  • March 4, 2016

Hi @arekpierchala, the RasterPaletteGenerator transformer might help you.


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

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

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
Celebrity
  • March 4, 2016

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

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

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+59

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