I built a Python script that downloads tiles from some map service. This service cannot be imported to QGIS as a tile layer so I decided to download tiles directly using
requests module. The script also performs a georeference task that is done by
SetGeoTransform method in
The service provided multiple output formats so I tested
*.bmp. As test shows,
*.png is fastest to download and close to the best quality.
*.bmp has the best quality but download time is too long.
In the end I have a set of georeferenced PNG images that need to be merged into one image file. The problem is based on keeping oroginal color of all images.
When I load images to QGIS, their colors were presented in normal condition:
Merged them them using
gdal_merge using this code:
attrs =['', '-o', 'out_file_merged.png', 'out_g_1', 'out_g_2', 'out_g_3', 'out_g_4', 'out_g_5'] gdal_merge.main(attrs)
But result was like this:
Right the only one way for me to keep colors is to download
*.bmp tiles. But is it possible for
gdal to operate with
*.png images and keep their colors?