<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I can't reproduce the issue you describe. There's not a single
white pixel in the output image (the max of the green and blue
bands is < 255). But I suspect this could be related to a
pre-existing composite-bl.tif file you might have. gdalwarp
doesn't overwrite by default the output image. It blends into it.
If you add -overwrite, you should get a reasonable output.<br>
</p>
<div class="moz-cite-prefix">Le 18/09/2021 à 01:06, Patrick Young a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CADXYQQ7=8+i-CCUjwX_pTLC3g_ECfMV7RtAR7ULwbsd+fQhGGA@mail.gmail.com">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I've found behavior in gdalwarp related to compositing an
image with a variable alpha band. Under bilinear resampling,
the alpha compositing in areas where the alpha band is between
0 and 255 results in completely white pixels.</div>
<div><br>
</div>
<div>To reproduce, I've first grabbed a rgba image from the test
suite, e.g.:<br>
<br>
wget <a
href="https://github.com/OSGeo/gdal/raw/a2db646d1c34905e47eb21657284b529b7478d66/autotest/gcore/data/stefan_full_rgba.tif"
moz-do-not-send="true">https://github.com/OSGeo/gdal/raw/a2db646d1c34905e47eb21657284b529b7478d66/autotest/gcore/data/stefan_full_rgba.tif</a><br>
</div>
<div><br>
</div>
<div>Then,</div>
<div><br>
gdal_create -ot Byte -bands 3 -burn 71 147 240 -outsize 162
150 -a_srs EPSG:3857 -a_ullr 0 162 150 0 background.tif<br>
gdal_translate -a_srs EPSG:3857 -a_ullr 0 162 150 0
stefan_full_rgba.tif foreground.tif<br>
gdalwarp -r bilinear background.tif foreground.tif
composite-bl.tif<br>
</div>
<div><br>
</div>
<div>In this case, composite-bl.tif is white wherever the alpha
is in [1, 254]. Trying<br>
<br>
gdalwarp background.tif foreground.tif composite-nn.tif<br>
<br>
produces a reasonable image, although it is blocker than when
I overlay background.tif and foreground.tif in qgis.</div>
<div><br>
</div>
<div>Thanks for any tips about what I'm seeing, happy to file a
bug if it is one! I've tested this on gdal 3.2.2 on macos
(from brew).</div>
<div>Patrick</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>