<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi,
<div class="">Thanks for the code but it doesn’t work :/</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">ERROR 5: map_11_0_309.tiff: GDALDataset::GetRasterBand(2) - Illegal band #</span></div>
</div>
<div class=""><br class="">
</div>
<div class="">it is quite complex to understand and the help of gdal is not very provided…</div>
<div class=""><br class="">
</div>
<div class="">this is what gdalinfo returns to me</div>
<div class="">For .tiff :</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">gdalinfo map_11_0_309.tiff </span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Driver: GTiff/GeoTIFF</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Files: map_11_0_309.tiff</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Size is 256, 256</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Coordinate System is:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">GEOGCS["WGS 84",</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    DATUM["WGS_1984",</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">        SPHEROID["WGS 84",6378137,298.257223563,</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">            AUTHORITY["EPSG","7030"]],</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">        AUTHORITY["EPSG","6326"]],</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    PRIMEM["Greenwich",0],</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    UNIT["degree",0.0174532925199433],</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    AUTHORITY["EPSG","4326"]]</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Origin = (-180.000000000000000,-18.632812500000000)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Pixel Size = (0.001373291015625,-0.001373291015625)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Metadata:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  AREA_OR_POINT=Area</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Image Structure Metadata:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  INTERLEAVE=BAND</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Corner Coordinates:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Upper Left  (-180.0000000, -18.6328125) (180d 0' 0.00"W, 18d37'58.13"S)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Lower Left  (-180.0000000, -18.9843750) (180d 0' 0.00"W, 18d59' 3.75"S)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Upper Right (-179.6484375, -18.6328125) (179d38'54.38"W, 18d37'58.13"S)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Lower Right (-179.6484375, -18.9843750) (179d38'54.38"W, 18d59' 3.75"S)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Center      (-179.8242188, -18.8085938) (179d49'27.19"W, 18d48'30.94"S)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Band 1 Block=256x128 Type=Byte, ColorInterp=Palette</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  Image Structure Metadata:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    NBITS=2</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  Color Table (RGB with 4 entries)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    0: 60,89,96,255</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    1: 109,178,200,255</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    2: 138,193,212,255</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    3: 161,205,220,255</span></div>
</div>
<div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class="">
</span></div>
<div class="">
<div>For the original png :</div>
<div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">gdalinfo map_11_0_309.png</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Driver: PNG/Portable Network Graphics</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Files: map_11_0_309.png</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Size is 256, 256</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Coordinate System is `'</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Corner Coordinates:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Upper Left  (    0.0,    0.0)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Lower Left  (    0.0,  256.0)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Upper Right (  256.0,    0.0)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Lower Right (  256.0,  256.0)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Center      (  128.0,  128.0)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Band 1 Block=256x1 Type=Byte, ColorInterp=Palette</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  Image Structure Metadata:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    NBITS=2</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  Color Table (RGB with 4 entries)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    0: 60,89,96,255</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    1: 109,178,200,255</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    2: 138,193,212,255</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    3: 161,205,220,255</span></div>
<div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class="">
</span></div>
<div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">RGB 59,89,95,255 is missing in this tile</span></div>
<div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class="">
</span></div>
<div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">
<div class="">Is it possible, via gdal_calc.py, or goal_translate or other program (that I don’t know) to tell him:</div>
<div class="">If, in the color table, RGB 59,89,95,255 AND / OR RGB 60,89,96,255 are present it is necessary to replace them with RGB 255, 255, 255, 255 and all the other entries are to be replaced by RGB 0, 0, 0 , 255 ?</div>
<div class=""><br class="">
</div>
<div class="">which would only make 2 entries in the color table on 1 band.</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
</span></div>
</div>
<div>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>