Solved

Workflow for RGBN Geotiff to RGB PNG

  • 15 December 2017
  • 4 replies
  • 16 views

Hi,

I am looking to create a workflow that allows the conversion of large raster data sets from Geotiff to PNG format for use in a web based platform. Typically, this will require a transformation of individual raster tiles from a state plane coordinate system to a UTM coordinate system. The issue we are having is accounting for the rotation of the image after transformation and assigning a transparency to the no data areas that are generated. Most of the rasters we will be processing will be 32bit (8bit per channel) 4 band RGBN Geotiff orthophotography tiles. The PNG images to be created will be RGB with the near-infrared band stripped out. We do need to allow for transparency in the no data areas of each image tile. Ultimately, the PNG images will be ingested into MapProxy and displayed as a seamless mosaic. This will require the no data areas to be transparent.

The FME workflow we have developed so far uses the RASTER INTERPRETATION COERCER to add an alpha band to the transformed PNG images. Unfortunately, the PNG displays a black border around the image in the no data areas.

Can FME process these 4 band geotiffs into RGB PNG while assigning a transparency layer to the no data areas? Would a clipper be required?

icon

Best answer by fmelizard 16 December 2017, 01:14

View original

4 replies

Userlevel 4
Badge +13

Hi @joseph1905

I think for best results in your case I would recommend adding the alpha band before reprojecting. You shouldn't need a clipper here. For RGB I understand that it is best practice to use the alpha band to set transparently instead of trying to assign a NoData value.

 

 

By default when FME Reprojects it does not add NoData values to the created points.

I would recommend a workflow whereby you remove the 4th band (RasterSelecter>RasterBandRemover) followed by creating the alpha band (RasterInterpretationCoercer to RGBA). Then use the CsmapReprojector to reproject. The 'no data' area should then have the correct transparency set.

Userlevel 2
Badge +17

Hi @joseph1905, the RasterInterpretationCoercer with this setting can generate Alpha band as expected, if the interpretation of input raster is RGB (3 bands) and Nodata value is set to the value of cells which should be transparent.

  • Destination Interpretation Type: RGBA32
  • RGB to RGBA: Create alpha band from nodata

The point is how you can transform the source GeoTIFF raster to a RGB 3 band raster with Nodata.

I'm not sure what the fourth band "N" in the source GeoTIFF means. Could you please clarify this point? Or could you post a sample GeoTIFF dataset here?

Takashi, Matt

These 4 band images are multispectral with the 4thband “N” being near-infrared. Conventionally, a RGBN image can setup up to display a CIR (Colorinfrared) image with the NIR band displayed as a red tone. For this data set we need to remove the NIR band and create a RGB image that contains a transparent layer for backgrounddisplay and mosaics.

We were able to successfully complete the conversion by usingRasterInterpretationCoercer RGBA32 and creating an opaque alpha band. This will also work when the source image is3band RGB.

Workflow is attached. Thank you so much for your assistance.

rgbn-to-rgbpng.fmw

Userlevel 4
Badge +13

Takashi, Matt

These 4 band images are multispectral with the 4thband “N” being near-infrared. Conventionally, a RGBN image can setup up to display a CIR (Colorinfrared) image with the NIR band displayed as a red tone. For this data set we need to remove the NIR band and create a RGB image that contains a transparent layer for backgrounddisplay and mosaics.

We were able to successfully complete the conversion by usingRasterInterpretationCoercer RGBA32 and creating an opaque alpha band. This will also work when the source image is3band RGB.

Workflow is attached. Thank you so much for your assistance.

rgbn-to-rgbpng.fmw

Excellent thanks for letting us know it worked and sharing your workspace!

 

 

Reply