1

I encounter some weird problem when creating tiles from GeoTIFF.

Context: I am generating small tiles from a large GeoTIFF image. The B and R band were swapped so I had to do a gdal_translate to swap the band into the correct order for generating PNG tiles from this GeoTIFF. Since I need the georeferencing, I first created a set of smaller GeoTIFF tiles from the large GeoTIFF tiles before converting these smaller GeoTIFF tiles into PNG with worldfiles.

When I try to look at the PNG files, it gave me some weird looking picture. Looking at it, seems like the band is missing or overly saturated to white.

Geo TIFF generated from gdal, loading in QGIS and also view in preview on Mac. All seems fine.

enter image description here

I converted this to a PNG files via gdal_translate and it gave me this picture. enter image description here

What can I try?

2
  • 1
    Run gdalinfo for the original image and add the report to your question. Perhaps you have a 4 band RGB-NIR image and the 4th band is interpreted to be an alpha in the conversion.
    – user30184
    Oct 24, 2019 at 20:53
  • Hi there thanks for the solution.
    – snookrun
    Oct 27, 2019 at 6:19

1 Answer 1

2

As with what @user30184 said, the issue is with the 4th NIR band been read as the mask band. After only extracting 3 band then writing it out, the PNG shows the correct picture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.