<p>I&#39;m trying to build a mosaic, and I rely on the NoDataValue feature to treat some parts of the image as transparent.<br>
However, it appears that GDAL doesn&#39;t work as expected.</p>
<p>I also created a very simple test case using a vrt dataset and gdal_translate - and I get the same results (that is - the 2nd image draws over the 1st image, ignoring &quot;transparent areas&quot;)</p>
<p>I have to 100X100 image files with a white marking (different in each file) over black background (black being exactly equal to 0)<br>
I built a simple vrt file:</p>
<p>    &lt;VRTDataset rasterXSize=&quot;100&quot; rasterYSize=&quot;100&quot;&gt;<br>
      &lt;VRTRasterBand dataType=&quot;Byte&quot; band=&quot;1&quot;&gt;<br>
        &lt;ColorInterp&gt;Gray&lt;/ColorInterp&gt;<br>
        &lt;SimpleSource&gt;<br>
          &lt;SourceFilename relativeToVRT=&quot;1&quot;&gt;a1.tif&lt;/SourceFilename&gt;<br>
          &lt;SourceBand&gt;1&lt;/SourceBand&gt;<br>
          &lt;SrcRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;100&quot; ySize=&quot;100&quot;/&gt;<br>
          &lt;DstRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;100&quot; ySize=&quot;100&quot;/&gt;<br>
              &lt;HideNoDataValue&gt;1&lt;/HideNoDataValue&gt;<br>
              &lt;NoDataValue&gt;0&lt;/NoDataValue&gt;<br>
        &lt;/SimpleSource&gt;<br>
        &lt;SimpleSource&gt;<br>
          &lt;SourceFilename relativeToVRT=&quot;1&quot;&gt;a2.tif&lt;/SourceFilename&gt;<br>
          &lt;SourceBand&gt;1&lt;/SourceBand&gt;<br>
          &lt;SrcRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;100&quot; ySize=&quot;100&quot;/&gt;<br>
          &lt;DstRect xOff=&quot;0&quot; yOff=&quot;0&quot; xSize=&quot;100&quot; ySize=&quot;100&quot;/&gt;<br>
              &lt;HideNoDataValue&gt;1&lt;/HideNoDataValue&gt;<br>
              &lt;NoDataValue&gt;0&lt;/NoDataValue&gt;<br>
        &lt;/SimpleSource&gt;<br>
      &lt;/VRTRasterBand&gt;<br>
    &lt;/VRTDataset&gt;<br>
and I run the command:</p>
<p>    gdal_translate mosaic.vrt mosaic.tif</p>
<p>The result is identical to image `a2.tif`, instead of being a combination of `a1.tif` and `a2.tif`</p>
<p>I got the error using gdal 1.8 and 1.9</p>
<p>any ideas?</p>