## Expected behavior and actual behavior.
The generation of Cloud-Optimized GeoTIFF images sometimes includes an fringe of random colors around the edge of opaque and transparent pixels of the coarser zoom levels.
The edge of a COG level with an alpha channel should be a smooth tapering of translucent pixels with the proper colors from the source image.
## Steps to reproduce the problem.
Using GDAL-3.3.1, take an image [like this, naip_denull.tif](https://drive.google.com/file/d/1KIJ-8E3nxxaVCdQ1uaKE4rcZtCtlqT0x/view?usp=sharing) (188 MB) and run:
$ gdal_translate naip_denull.tif cog.tif -of COG -co COMPRESS=LZW
Then open the COG in an application like GIMP that lets you select which zoom-level to view. Choose the coarsest level and view — random fringe!
Screenshot: 
All of the reduced-resolution levels have this problem to a degree, though the more zoomed-out ones have it worse. Using these levels to produce a map makes it look bad.
The problem seems to be exacerbated by the source image having pixels that are either fully opaque or fully transparent and by the image content having complicated patterns, such as streets.
My guess is that the resampling method when generating a zoomed-out pixel is indiscriminately including source-pixel values that are fully transparent and shouldn't be included. The randomness of the fringe suggests that the sample values for transparent pixels remain uninitialized as some kind of optimization.
I've seen this problem before on other systems with a dark fringe from erroneously including transparent pixels that have sample values of 0.
## Operating system
Fedora 33 Linux, x64.
## GDAL version and provenance
GDAL-3.3.1.
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev