Question

rasterbandseperated images load in with grey palette rather than their single RGB palette


Badge +3

rasterbandseperated images load in with grey palette rather than their single RGB palette. Once i separate using the seperater and QC the images in FME they look fine. Red (0) looks and is displayed as red(8). However when i write out to geotiff and load into any software or even read back into FME the imagery is grey(8). This is the same for all 3 outputs. I hope i'm missing some easy step. All i'm wanting to do is to be able to produce a RGB image and then be able to have the seperate R / G / B images to look at.


6 replies

Userlevel 2
Badge +17

As far as I know, most raster formats won't preserve color interpretation for individual bands (only the exception I know is the FFS - FME Feature Store).

Usually color interpretations of bands in a 3-band color image raster are determined by the rendering software according to the order of the bands (i.e. 0: red, 1: green, 2: blue), and a single-band raster would be interpreted as a gray scale image raster or a numeric raster, by default.

That is, in your workspace, even if the raster feature had a single band with Red8 (or Green8 or Blue8) interpretation before writing into a GeoTIFF file, the resulting file would not preserve the color interpretation. Therefore, I don't think you can avoid that the resulting single band raster would be interpreted as a gray scale raster when you read it.

However, in some softwares (e.g. QGIS), optionally you can set the color interpretation for rendering. In FME, of course, you can change band interpretation with the RasterBandInterpretationCoercer, even if the source raster has read as a gray scale raster.

Badge +3

@clindsey, @takashi

There is a way to do this..as usual :)

 

1. Rasterselector on your input. (select 1 band. )

2. RasterBandKeeper

3. RasterBandAdder (2x; one for each not selected band in step 1)

set the Cell Value = 0 and no NoData Value

 

Write to GEotiff.

Output example for slected Band 0:

 

Badge +3

here is wb pic

Userlevel 2
Badge +17

@clindsey, @takashi

There is a way to do this..as usual :)

 

1. Rasterselector on your input. (select 1 band. )

2. RasterBandKeeper

3. RasterBandAdder (2x; one for each not selected band in step 1)

set the Cell Value = 0 and no NoData Value

 

Write to GEotiff.

Output example for slected Band 0:

 

That's a 3-band RGB color raster having 0 in green and blue channels. If it's the desired result, you can just use the RasterSelector and the RasterCellValueReplacer.

Badge +3

@takashi @clindsey

Yes it is 3band.

 

As we cannot admit defeat here is a single band tiff creator.

The trick being to add a palette, stringreplace the other bands to 0 and interpretation from RGBA32 (in my case) to RGB24 and coerce intepretation to unsigned8

 

singleband2tiff.fmw

 

Badge +3

@takashi @clindsey

result for singleband2tiff.fmw

 

So it is possible to do this.

Adn it is not a new question (well .. maybe on this forum )

 

Reply