Skip to main content

Hi community!
I’d like to know how to make the white background of this image transparent and change the black color of the geographic region to white. It’s important to keep the original resolution and export the file in Uint16 format.


I’ve attached the image: could someone kindly apply this transformation and send me back the modified version?
Thank you so much!

Hi ​@gbcfgeo2025 ,

The interpretation of the source PNG raster is RGBA32 and it only has 2 values - opaque black (0,0,0,255) and opeque white (255,255,255,255). You can use RasterExpressionEvaluator easely convert it to Uint16 single-band binary raster whose cell values are 0 or 255 for example. The setting example is shown below.

RasterExpressionEvaluator Setting Example

Uint16 single-band raster itself cannot represent colors, but you can set this palette to the raster with RasterPaletteAdder in order to assign color (R,G, B) for each cell value.

RGB24
0 255,255,255
255 0,0,0

General image processing softwares would interpret it as RGB24 raster - 0 to white (255,255,255), 255 to black (0,0,0).

Finally, you can use RasterBandNodataSetter to set cell value 255 (background) as Nodata.

Strictly speaking, Nodata is not equivalent to transparent. You can define RGBA32 palette which represent tansparency with Alpha band, but as far as I know, there is no raster file format supporting RGBA32 palette.