Opened 13 years ago

Closed 13 years ago

#3821 closed defect (fixed) handles alpha incorrectly (patch)

Reported by: cdestigter Owned by: warmerdam
Priority: normal Milestone: 1.8.0
Component: Utilities Version: svn-trunk
Severity: normal Keywords:

Description doesn't handle alpha channels properly. This results in semi-transparent black shadows when resampling input images. The black borders are more obvious in highly shrunk (ie from high res to low res) output.

EvenR helped me out with the attached patch, which fixes the problem by setting band interpretation correctly in, and using it in GDALReprojectImage.

Here's my command line:

rm -r ~/tmp/retiled
mkdir ~/tmp/retiled -v -co ALPHA=YES -ps 4096 4096 -ot Byte -r bilinear -levels 4 -targetDir ~/tmp/retiled ~/tmp/src-images/0000000*.tif

I'll also attach some tiny RGBA test tiffs which demonstrate the problem. Compare the output in levels 3 and 4 of output before and after patching.

Attachments (2)

gdal-retile-alpha-fix.patch (2.5 KB ) - added by cdestigter 13 years ago. (922.0 KB ) - added by cdestigter 13 years ago.

Download all attachments as: .zip

Change History (3)

by cdestigter, 13 years ago

Attachment: gdal-retile-alpha-fix.patch added

by cdestigter, 13 years ago

comment:1 by Even Rouault, 13 years ago

Component: defaultUtilities
Milestone: 1.8.0
Resolution: fixed
Status: newclosed

r21095 /trunk/gdal/alg/gdalwarper.cpp: GDALReprojectImage() : correctly assign nSrcAlphaBand and nDstAlphaBand (#3821)

r21096 /trunk/gdal/swig/python/scripts/ : assign color interpretation (#3821)

r21097 /trunk/autotest/ (gcore/data/rgba.tif pyscripts/ Test with RGBA dataset (#3821)

Note: See TracTickets for help on using tickets.