[gdal-dev] to make black triangle transparent (gdalwarp)

Jan Tappenbeck tappenbeck at widemann.de
Thu Nov 3 05:45:05 EDT 2011



    hi !

i had transform some tif-files by epsg-code so the images will rotate 
and at the border now some black triangles.

now i want to merge by gdalwarp and i use following command with the 
dstalpha-option:

C:\Program Files (x86)\FWTools2.4.7>gdalwarp 
-dstalpha[Path]\geotiff\trans_a.tif [Path]OP\geotiff\t
rans_b.tif [Path]OP\geotiff\TEST.tif
Creating output file that is 20382P x 10788L.
Processing input file [Path]OP\geotiff\trans_a.tif.

0...10...20...30...40...50...60...70...80...90...100 - done.
Processing input file [Path]OP\geotiff\trans_b.tif.

0...10...20...30...40...50...60...70...80...90...100 - done.


here are some image-information:

C:\Program Files (x86)\FWTools2.4.7>gdalinfo [Path]
OP\geotiff\trans_a.tif
Driver: GTiff/GeoTIFF
Files: [Path]OP\geotiff\trans_a.tif
Size is 10390, 10390
Coordinate System is:
PROJCS["DHDN / 3-degree Gauss-Kruger zone 2",
     GEOGCS["DHDN",
         DATUM["Deutsches_Hauptdreiecksnetz",
             SPHEROID["Bessel 1841",6377397.155,299.1528128000009,
                 AUTHORITY["EPSG","7004"]],
             AUTHORITY["EPSG","6314"]],
         PRIMEM["Greenwich",0],
         UNIT["degree",0.0174532925199433],
         AUTHORITY["EPSG","4314"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",0],
     PARAMETER["central_meridian",6],
     PARAMETER["scale_factor",1],
     PARAMETER["false_easting",2500000],
     PARAMETER["false_northing",0],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]],
     AUTHORITY["EPSG","31466"]]
Origin = (2601576.178792405400000,5477422.986974134100000)
Pixel Size = (0.200049845331526,-0.200049845331526)
Metadata:
   AREA_OR_POINT=Area
Image Structure Metadata:
   INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 2601576.179, 5477422.987) (  7d24'1.33"E, 49d25'34.75"N)
Lower Left  ( 2601576.179, 5475344.469) (  7d23'59.41"E, 49d24'27.48"N)
Upper Right ( 2603654.697, 5477422.987) (  7d25'44.45"E, 49d25'33.49"N)
Lower Right ( 2603654.697, 5475344.469) (  7d25'42.50"E, 49d24'26.22"N)
Center      ( 2602615.438, 5476383.728) (  7d24'51.92"E, 49d25'0.49"N)
Band 1 Block=10390x1 Type=Byte, ColorInterp=Red
Band 2 Block=10390x1 Type=Byte, ColorInterp=Green
Band 3 Block=10390x1 Type=Byte, ColorInterp=Blue

could someone tell me how to make the black triangel transparenzy ?

when i move the mousemarker over the black triangle in the OpenEV-Viewer 
in the statusline 0,0,0 will show.

regards Jan :-)

FWTools2.4.7 in use by win7



More information about the gdal-dev mailing list