<div dir="ltr">Boa tarde,<br><br>Penso que o mais simples será criar um raster virtual com transparência, e posteriormente fazer a conversão deste para tif<div><br></div><div>Exemplo:</div><div><br></div><div>1. gdalbuildvrt -srcnodata "255 255 255" destino.vrt entrada.jpg </div><div>2. gdal_translate -of Gtiff destino.vrt destino.tif<br><br>Cumprimentos,</div><div>Pedro Monteiro</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 19, 2016 at 2:13 PM Marco Afonso <<a href="mailto:mafonso333@gmail.com">mafonso333@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Boa tarde,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Julgo que a questão será direccionada para os GDAL masters :)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Gostaria de saber se é possível converter um ficheiro no formato JP2000 para TIF com transparência. Se possível definir a côr branco (RGB <a href="tel:255%20255%20255" value="+351255255255" class="gmail_msg" target="_blank">255 255 255</a>) para transparência.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Compressão para o ficheiro de saída TIF não é requisito para já.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Segue a informação obtida pelo GDALINFO do ficheiro de origem.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Obrigado! :)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">Driver: JP2MrSID/MrSID JPEG2000</div><div class="gmail_msg">Files: pu_luz_zonamento.jp2</div><div class="gmail_msg">       pu_luz_zonamento.jp2.ovr</div><div class="gmail_msg">       pu_luz_zonamento.jp2.aux.xml</div><div class="gmail_msg">Size is 6636, 6122</div><div class="gmail_msg">Coordinate System is:</div><div class="gmail_msg">PROJCS["ETRS_1989_TM06-Portugal",</div><div class="gmail_msg">    GEOGCS["GCS_ETRS_1989",</div><div class="gmail_msg">        DATUM["European_Terrestrial_Reference_System_1989",</div><div class="gmail_msg">            SPHEROID["GRS_1980",6378137,298.257222101,</div><div class="gmail_msg">                AUTHORITY["EPSG","7019"]],</div><div class="gmail_msg">            AUTHORITY["EPSG","6258"]],</div><div class="gmail_msg">        PRIMEM["Greenwich",0],</div><div class="gmail_msg">        UNIT["degree",0.0174532925199433]],</div><div class="gmail_msg">    PROJECTION["Transverse_Mercator"],</div><div class="gmail_msg">    PARAMETER["latitude_of_origin",39.66825833333333],</div><div class="gmail_msg">    PARAMETER["central_meridian",-8.133108333333333],</div><div class="gmail_msg">    PARAMETER["scale_factor",1],</div><div class="gmail_msg">    PARAMETER["false_easting",0],</div><div class="gmail_msg">    PARAMETER["false_northing",0],</div><div class="gmail_msg">    UNIT["metre",1,</div><div class="gmail_msg">        AUTHORITY["EPSG","9001"]]]</div><div class="gmail_msg">Origin = (37881.833519887965000,-285245.409715688320000)</div><div class="gmail_msg">Pixel Size = (0.169333333333329,-0.169333333333331)</div><div class="gmail_msg">Metadata:</div><div class="gmail_msg">  Corder=PCRL</div><div class="gmail_msg">  GEOTIFF_CHAR__GeogAngularUnitsGeoKey=Angular_Degree</div><div class="gmail_msg">  GEOTIFF_CHAR__GeogGeodeticDatumGeoKey=Datum_European_Reference_System_1989</div><div class="gmail_msg">  GEOTIFF_CHAR__GeographicTypeGeoKey=User-Defined</div><div class="gmail_msg">  GEOTIFF_CHAR__GTModelTypeGeoKey=ModelTypeProjected</div><div class="gmail_msg">  GEOTIFF_CHAR__GTRasterTypeGeoKey=RasterPixelIsArea</div><div class="gmail_msg">  GEOTIFF_CHAR__ProjCoordTransGeoKey=CT_TransverseMercator</div><div class="gmail_msg">  GEOTIFF_CHAR__ProjectedCSTypeGeoKey=User-Defined</div><div class="gmail_msg">  GEOTIFF_CHAR__ProjectionGeoKey=User-Defined</div><div class="gmail_msg">  GEOTIFF_CHAR__ProjLinearUnitsGeoKey=Linear_Meter</div><div class="gmail_msg">  GEOTIFF_NUM__1024__GTModelTypeGeoKey=1</div><div class="gmail_msg">  GEOTIFF_NUM__1025__GTRasterTypeGeoKey=1</div><div class="gmail_msg">  GEOTIFF_NUM__1026__GTCitationGeoKey=PCS Name = ETRS_1989_TM06-Portugal</div><div class="gmail_msg">  GEOTIFF_NUM__2048__GeographicTypeGeoKey=32767</div><div class="gmail_msg">  GEOTIFF_NUM__2049__GeogCitationGeoKey=GCS Name = GCS_ETRS_1989|Ellipsoid = GRS_1980|Primem = Greenwich|</div><div class="gmail_msg">  GEOTIFF_NUM__2050__GeogGeodeticDatumGeoKey=6258</div><div class="gmail_msg">  GEOTIFF_NUM__2054__GeogAngularUnitsGeoKey=9102</div><div class="gmail_msg">  GEOTIFF_NUM__2057__GeogSemiMajorAxisGeoKey=6378137.000000</div><div class="gmail_msg">  GEOTIFF_NUM__2059__GeogInvFlatteningGeoKey=298.257222</div><div class="gmail_msg">  GEOTIFF_NUM__2061__GeogPrimeMeridianLongGeoKey=0.000000</div><div class="gmail_msg">  GEOTIFF_NUM__3072__ProjectedCSTypeGeoKey=32767</div><div class="gmail_msg">  GEOTIFF_NUM__3074__ProjectionGeoKey=32767</div><div class="gmail_msg">  GEOTIFF_NUM__3075__ProjCoordTransGeoKey=1</div><div class="gmail_msg">  GEOTIFF_NUM__3076__ProjLinearUnitsGeoKey=9001</div><div class="gmail_msg">  GEOTIFF_NUM__3080__ProjNatOriginLongGeoKey=-8.133108</div><div class="gmail_msg">  GEOTIFF_NUM__3081__ProjNatOriginLatGeoKey=39.668258</div><div class="gmail_msg">  GEOTIFF_NUM__3082__ProjFalseEastingGeoKey=0.000000</div><div class="gmail_msg">  GEOTIFF_NUM__3083__ProjFalseNorthingGeoKey=0.000000</div><div class="gmail_msg">  GEOTIFF_NUM__3092__ProjScaleAtNatOriginGeoKey=1.000000</div><div class="gmail_msg">Image Structure Metadata:</div><div class="gmail_msg">  INTERLEAVE=PIXEL</div><div class="gmail_msg">Corner Coordinates:</div><div class="gmail_msg">Upper Left  (   37881.834, -<a href="tel:285%20245%20410" value="+351285245410" class="gmail_msg" target="_blank">285245.410</a>) (  7d42'25.13"W, 37d 5'52.09"N)</div><div class="gmail_msg">Lower Left  (   37881.834, -<a href="tel:286%20282%20068" value="+351286282068" class="gmail_msg" target="_blank">286282.068</a>) (  7d42'25.32"W, 37d 5'18.46"N)</div><div class="gmail_msg">Upper Right (   39005.530, -<a href="tel:285%20245%20410" value="+351285245410" class="gmail_msg" target="_blank">285245.410</a>) (  7d41'39.62"W, 37d 5'51.92"N)</div><div class="gmail_msg">Lower Right (   39005.530, -<a href="tel:286%20282%20068" value="+351286282068" class="gmail_msg" target="_blank">286282.068</a>) (  7d41'39.82"W, 37d 5'18.29"N)</div><div class="gmail_msg">Center      (   38443.682, -<a href="tel:285%20763%20739" value="+351285763739" class="gmail_msg" target="_blank">285763.739</a>) (  7d42' 2.47"W, 37d 5'35.19"N)</div><div class="gmail_msg">Band 1 Block=1024x128 Type=Byte, ColorInterp=Red</div><div class="gmail_msg">  Min=0.000 Max=255.000 </div><div class="gmail_msg">  Minimum=0.000, Maximum=255.000, Mean=236.038, StdDev=66.045</div><div class="gmail_msg">  NoData Value=256</div><div class="gmail_msg">  Overviews: 3318x3061, 1659x1531, 830x766, 415x383, 208x192</div><div class="gmail_msg">  Metadata:</div><div class="gmail_msg">    STATISTICS_COVARIANCES=4361.995430900208,2244.864802420663,3368.225850604773</div><div class="gmail_msg">    STATISTICS_MAXIMUM=255</div><div class="gmail_msg">    STATISTICS_MEAN=236,03793160725</div><div class="gmail_msg">    STATISTICS_MINIMUM=0</div><div class="gmail_msg">    STATISTICS_SKIPFACTORX=1</div><div class="gmail_msg">    STATISTICS_SKIPFACTORY=1</div><div class="gmail_msg">    STATISTICS_STDDEV=66,045404313247</div><div class="gmail_msg">  Image Structure Metadata:</div><div class="gmail_msg">    COMPRESSION=JP2000</div><div class="gmail_msg">Band 2 Block=1024x128 Type=Byte, ColorInterp=Green</div><div class="gmail_msg">  Min=0.000 Max=255.000 </div><div class="gmail_msg">  Minimum=0.000, Maximum=255.000, Mean=218.476, StdDev=87.277</div><div class="gmail_msg">  NoData Value=256</div><div class="gmail_msg">  Overviews: 3318x3061, 1659x1531, 830x766, 415x383, 208x192</div><div class="gmail_msg">  Metadata:</div><div class="gmail_msg">    STATISTICS_COVARIANCES=2244.864802420663,7617.276745283226,7051.036243014802</div><div class="gmail_msg">    STATISTICS_MAXIMUM=255</div><div class="gmail_msg">    STATISTICS_MEAN=218,47574597805</div><div class="gmail_msg">    STATISTICS_MINIMUM=0</div><div class="gmail_msg">    STATISTICS_SKIPFACTORX=1</div><div class="gmail_msg">    STATISTICS_SKIPFACTORY=1</div><div class="gmail_msg">    STATISTICS_STDDEV=87,277011551056</div><div class="gmail_msg">  Image Structure Metadata:</div><div class="gmail_msg">    COMPRESSION=JP2000</div><div class="gmail_msg">Band 3 Block=1024x128 Type=Byte, ColorInterp=Blue</div><div class="gmail_msg">  Min=0.000 Max=255.000 </div><div class="gmail_msg">  Minimum=0.000, Maximum=255.000, Mean=215.145, StdDev=92.105</div><div class="gmail_msg">  NoData Value=256</div><div class="gmail_msg">  Overviews: 3318x3061, 1659x1531, 830x766, 415x383, 208x192</div><div class="gmail_msg">  Metadata:</div><div class="gmail_msg">    STATISTICS_COVARIANCES=3368.225850604773,7051.036243014802,8483.403263628108</div><div class="gmail_msg">    STATISTICS_MAXIMUM=255</div><div class="gmail_msg">    STATISTICS_MEAN=215,14531106402</div><div class="gmail_msg">    STATISTICS_MINIMUM=0</div><div class="gmail_msg">    STATISTICS_SKIPFACTORX=1</div><div class="gmail_msg">    STATISTICS_SKIPFACTORY=1</div><div class="gmail_msg">    STATISTICS_STDDEV=92,105392152838</div><div class="gmail_msg">  Image Structure Metadata:</div><div class="gmail_msg">    COMPRESSION=JP2000</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div>-- <br class="gmail_msg"><div class="m_-9195676200023972830gmail_signature gmail_msg"><div dir="ltr" class="gmail_msg">Regards, <div class="gmail_msg">Marco Afonso</div><div class="gmail_msg"><a href="http://goo.gl/ZDtQjm" class="gmail_msg" target="_blank">http://goo.gl/ZDtQjm</a><br class="gmail_msg"></div><div class="gmail_msg"><span class="gmail_msg"></span><img src="https://dl.dropboxusercontent.com/u/17607469/qr.png" class="gmail_msg"><br class="gmail_msg"></div></div></div>
</div></div>
_______________________________________________<br class="gmail_msg">
Portugal mailing list<br class="gmail_msg">
<a href="mailto:Portugal@lists.osgeo.org" class="gmail_msg" target="_blank">Portugal@lists.osgeo.org</a><br class="gmail_msg">
<a href="http://lists.osgeo.org/mailman/listinfo/portugal" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a></blockquote></div>