Opened 13 years ago

Closed 8 years ago

Last modified 8 years ago

#3669 closed enhancement (fixed)

[PATCH] alpha mask

Reported by: stefanklug Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: Utilities Version: unspecified
Severity: normal Keywords:


Hi, doesn't handle tiff files with alpha masks so I've added this functionality.

My patch changes the behaviour of gdal_merge as follows:

  • If a band is recognized as Alpha Band it is automatically treated as having a NODATA value of 0.

I'm not sure if this is the way to go. But it makes some sense, as the resulting alpha channel is a correct alpha merge, independent of the nodata value used for the other bands.

  • If a band has mask flag GMF_ALPHA set, the mask band controls the parts that get written to the destination

Would be great if someone could review and possibly checkin the patch.



Attachments (1)

gdal_merge.patch (2.6 KB ) - added by stefanklug 13 years ago.

Download all attachments as: .zip

Change History (7)

by stefanklug, 13 years ago

Attachment: gdal_merge.patch added

comment:1 by Jukka Rahkonen, 9 years ago

This patch has never been reviewed.

comment:2 by Jukka Rahkonen, 9 years ago

Summary: alpha mask[PATCH] alpha mask

comment:3 by fxthomas, 8 years ago

The patch worked for me on GDAL 1.10.1, so +1. The raster files I work on generally have alpha masks, which makes unusable for most of my use cases.

comment:4 by Even Rouault, 8 years ago

Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r29213 " take into account alpha band to avoid writing zones of source images that are fully transparent (#3669, derived from patch by stefanklug)"

comment:5 by Even Rouault, 8 years ago

Above changeset caused regression. See #6067

comment:6 by Even Rouault, 8 years ago


Milestone renamed

Note: See TracTickets for help on using tickets.